Compare commits

...

23 Commits

Author SHA1 Message Date
Bram Moolenaar
ba07ce32cc updated for version 7.2.327 2010-01-06 18:25:34 +01:00
Bram Moolenaar
6f97701373 updated for version 7.2.326 2010-01-06 17:53:38 +01:00
Bram Moolenaar
70d60e9da1 updated for version 7.2-325 2009-12-31 13:53:33 +00:00
Bram Moolenaar
742d1ecd17 updated for version 7.2-324 2009-12-31 12:18:30 +00:00
Bram Moolenaar
281daf62aa updated for version 7.2-323 2009-12-24 15:11:40 +00:00
Bram Moolenaar
3084894793 updated for version 7.2-322 2009-12-24 14:46:12 +00:00
Bram Moolenaar
c7be3f30d0 updated for version 7.2-321 2009-12-24 14:01:12 +00:00
Bram Moolenaar
0a1c0ece44 updated for version 7.2-320 2009-12-16 18:02:47 +00:00
Bram Moolenaar
088598d7d6 updated for version 7.2-319 2009-12-16 17:49:39 +00:00
Bram Moolenaar
5d985b9cca updated for version 7.2-318 2009-12-16 17:28:07 +00:00
Bram Moolenaar
f5b6386f4f updated for version 7.2-317 2009-12-16 17:13:44 +00:00
Bram Moolenaar
56d1db3067 updated for version 7.2-316 2009-12-16 16:14:51 +00:00
Bram Moolenaar
72951077b9 updated for version 7.2-315 2009-12-02 16:58:33 +00:00
Bram Moolenaar
d7cd61723e updated for version 7.2-314 2009-12-02 16:47:11 +00:00
Bram Moolenaar
d7834d3065 updated for version 7.2-313 2009-12-02 16:14:36 +00:00
Bram Moolenaar
243973325e updated for version 7.2-312 2009-12-02 14:02:39 +00:00
Bram Moolenaar
f4888d0535 updated for version 7.2-311 2009-12-02 12:31:27 +00:00
Bram Moolenaar
43b36a3bc6 updated for version 7.2-310 2009-12-02 11:08:38 +00:00
Bram Moolenaar
d32a319f40 updated for version 7.2-309 2009-11-26 19:40:49 +00:00
Bram Moolenaar
5ea08a893a updated for version 7.2-308 2009-11-25 18:51:24 +00:00
Bram Moolenaar
d3005803d5 updated for version 7.2-307 2009-11-25 17:21:32 +00:00
Bram Moolenaar
099d01d4a7 updated for version 7.2-306 2009-11-25 16:14:45 +00:00
Bram Moolenaar
19f990e497 updated for version 7.2-305 2009-11-25 12:08:03 +00:00
23 changed files with 307 additions and 144 deletions

View File

@@ -2400,6 +2400,12 @@ au BufNewFile,BufRead /etc/xinetd.d/* call s:StarSetf('xinetd')
au BufNewFile,BufRead zsh*,zlog* call s:StarSetf('zsh')
" Use the filetype detect plugins. They may overrule any of the previously
" detected filetypes.
runtime! ftdetect/*.vim
" Generic configuration file (check this last, it's just guessing!)
au BufNewFile,BufRead,StdinReadPost *
\ if !did_filetype() && expand("<amatch>") !~ g:ft_ignore_pat
@@ -2408,10 +2414,6 @@ au BufNewFile,BufRead,StdinReadPost *
\ setf conf |
\ endif
" Use the plugin-filetype checks last, they may overrule any of the previously
" detected filetypes.
runtime! ftdetect/*.vim
augroup END

14
src/auto/configure vendored
View File

@@ -5126,7 +5126,7 @@ else
vi_cv_path_python_conf=
for path in "${vi_cv_path_python_pfx}" "${vi_cv_path_python_epfx}"; do
for subdir in lib share; do
for subdir in lib64 lib share; do
d="${path}/${subdir}/python${vi_cv_var_python_version}/config"
if test -d "$d" && test -f "$d/config.c"; then
vi_cv_path_python_conf="$d"
@@ -13718,8 +13718,8 @@ $as_echo "$ac_try_echo") >&5
$as_echo "pty mode: $vim_cv_tty_mode, group: $vim_cv_tty_group" >&6; }
else
vim_cv_tty_group=world
{ $as_echo "$as_me:$LINENO: result: ptys are world accessable" >&5
$as_echo "ptys are world accessable" >&6; }
{ $as_echo "$as_me:$LINENO: result: ptys are world accessible" >&5
$as_echo "ptys are world accessible" >&6; }
fi
else
@@ -13730,8 +13730,8 @@ sed 's/^/| /' conftest.$ac_ext >&5
( exit $ac_status )
vim_cv_tty_group=world
{ $as_echo "$as_me:$LINENO: result: can't determine - assume ptys are world accessable" >&5
$as_echo "can't determine - assume ptys are world accessable" >&6; }
{ $as_echo "$as_me:$LINENO: result: can't determine - assume ptys are world accessible" >&5
$as_echo "can't determine - assume ptys are world accessible" >&6; }
fi
rm -rf conftest.dSYM
@@ -17185,10 +17185,10 @@ $as_echo "yes" >&6; }
{ $as_echo "$as_me:$LINENO: result: no" >&5
$as_echo "no" >&6; }
fi
{ $as_echo "$as_me:$LINENO: checking whether we need -D_FORTIFY_SOURCE=1" >&5
{ $as_echo "$as_me:$LINENO: checking whether we need -D_FORTIFY_SOURCE=1" >&5
$as_echo_n "checking whether we need -D_FORTIFY_SOURCE=1... " >&6; }
if test "$gccmajor" -gt "3"; then
CFLAGS=`echo "$CFLAGS -D_FORTIFY_SOURCE=1" | sed -e 's/-Wp,-D_FORTIFY_SOURCE=2//g' -e 's/-D_FORTIFY_SOURCE=2//g'`
CFLAGS=`echo "$CFLAGS" | sed -e 's/-Wp,-D_FORTIFY_SOURCE=.//g' -e 's/-D_FORTIFY_SOURCE=.//g' -e 's/$/ -D_FORTIFY_SOURCE=1/'`
{ $as_echo "$as_me:$LINENO: result: yes" >&5
$as_echo "yes" >&6; }
else

View File

@@ -686,7 +686,7 @@ if test "$enable_pythoninterp" = "yes"; then
[
vi_cv_path_python_conf=
for path in "${vi_cv_path_python_pfx}" "${vi_cv_path_python_epfx}"; do
for subdir in lib share; do
for subdir in lib64 lib share; do
d="${path}/${subdir}/python${vi_cv_var_python_version}/config"
if test -d "$d" && test -f "$d/config.c"; then
vi_cv_path_python_conf="$d"
@@ -2557,11 +2557,11 @@ main()
AC_MSG_RESULT([pty mode: $vim_cv_tty_mode, group: $vim_cv_tty_group])
else
vim_cv_tty_group=world
AC_MSG_RESULT([ptys are world accessable])
AC_MSG_RESULT([ptys are world accessible])
fi
],[
vim_cv_tty_group=world
AC_MSG_RESULT([can't determine - assume ptys are world accessable])
AC_MSG_RESULT([can't determine - assume ptys are world accessible])
],[
AC_MSG_ERROR(cross-compiling: please set 'vim_cv_tty_group' and 'vim_cv_tty_mode')
])
@@ -3241,9 +3241,10 @@ if test "$GCC" = yes; then
fi
dnl -D_FORTIFY_SOURCE=2 crashes Vim on strcpy(buf, "000") when buf is
dnl declared as char x[1] but actually longer. Introduced in gcc 4.0.
dnl Also remove duplicate _FORTIFY_SOURCE arguments.
AC_MSG_CHECKING(whether we need -D_FORTIFY_SOURCE=1)
if test "$gccmajor" -gt "3"; then
CFLAGS=`echo "$CFLAGS -D_FORTIFY_SOURCE=1" | sed -e 's/-Wp,-D_FORTIFY_SOURCE=2//g' -e 's/-D_FORTIFY_SOURCE=2//g'`
CFLAGS=`echo "$CFLAGS" | sed -e 's/-Wp,-D_FORTIFY_SOURCE=.//g' -e 's/-D_FORTIFY_SOURCE=.//g' -e 's/$/ -D_FORTIFY_SOURCE=1/'`
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)

View File

@@ -7397,6 +7397,10 @@ in_cinkeys(keytyped, when, line_is_empty)
int icase;
int i;
if (keytyped == NUL)
/* Can happen with CTRL-Y and CTRL-E on a short line. */
return FALSE;
#ifdef FEAT_EVAL
if (*curbuf->b_p_inde != NUL)
look = curbuf->b_p_indk; /* 'indentexpr' set: use 'indentkeys' */

View File

@@ -12014,6 +12014,7 @@ f_histadd(argvars, rettv)
str = get_tv_string_buf(&argvars[1], buf);
if (*str != NUL)
{
init_history();
add_to_history(histype, str, FALSE, NUL);
rettv->vval.v_number = TRUE;
return;
@@ -15541,7 +15542,8 @@ f_setpos(argvars, rettv)
{
if (list2fpos(&argvars[1], &pos, &fnum) == OK)
{
--pos.col;
if (--pos.col < 0)
pos.col = 0;
if (name[0] == '.' && name[1] == NUL)
{
/* set cursor */

View File

@@ -4422,7 +4422,8 @@ ExpandFromContext(xp, pat, num_file, file, options)
flags |= EW_FILE;
else
flags = (flags | EW_DIR) & ~EW_FILE;
ret = expand_wildcards(1, &pat, num_file, file, flags);
/* Expand wildcards, supporting %:h and the like. */
ret = expand_wildcards_eval(&pat, num_file, file, flags);
if (free_pat)
vim_free(pat);
return ret;

View File

@@ -21,7 +21,7 @@
#include "vim.h"
#ifdef __TANDEM
#if defined(__TANDEM) || defined(__MINT__)
# include <limits.h> /* for SSIZE_MAX */
#endif
@@ -2981,6 +2981,13 @@ buf_write(buf, fname, sfname, start, end, eap, append, forceit,
if (fname == NULL || *fname == NUL) /* safety check */
return FAIL;
if (buf->b_ml.ml_mfp == NULL)
{
/* This can happen during startup when there is a stray "w" in the
* vimrc file. */
EMSG(_(e_emptybuf));
return FAIL;
}
/*
* Disallow writing from .exrc and .vimrc in current directory for

View File

@@ -212,12 +212,14 @@ typedef struct _DllVersionInfo
DWORD dwPlatformID;
} DLLVERSIONINFO;
#include <poppack.h>
typedef struct tagTOOLINFOA_NEW
{
UINT cbSize;
UINT uFlags;
HWND hwnd;
UINT uId;
UINT_PTR uId;
RECT rect;
HINSTANCE hinst;
LPSTR lpszText;
@@ -227,15 +229,13 @@ typedef struct tagTOOLINFOA_NEW
typedef struct tagNMTTDISPINFO_NEW
{
NMHDR hdr;
LPTSTR lpszText;
LPSTR lpszText;
char szText[80];
HINSTANCE hinst;
UINT uFlags;
LPARAM lParam;
} NMTTDISPINFO_NEW;
#include <poppack.h>
typedef HRESULT (WINAPI* DLLGETVERSIONPROC)(DLLVERSIONINFO *);
#ifndef TTM_SETMAXTIPWIDTH
# define TTM_SETMAXTIPWIDTH (WM_USER+24)

View File

@@ -1274,13 +1274,12 @@ gui_xm_select_font(char_u *current)
XtAppProcessEvent(XtWidgetToApplicationContext(data->dialog),
(XtInputMask)XtIMAll);
XtDestroyWidget(data->dialog);
if (data->old)
{
XFreeFont(XtDisplay(data->dialog), data->old);
XmFontListFree(data->old_list);
}
XtDestroyWidget(data->dialog);
gui_motif_synch_fonts();

View File

@@ -70,14 +70,6 @@ typedef struct
Scheme_Object *port;
} Port_Info;
/* info for do_apply */
typedef struct
{
Scheme_Object *proc;
int argc;
Scheme_Object **argv;
} Apply_Info;
/*
*========================================================================
* Vim-Control Commands
@@ -160,7 +152,6 @@ static Scheme_Object *_apply_thunk_catch_exceptions(
static Scheme_Object *extract_exn_message(Scheme_Object *v);
static Scheme_Object *do_eval(void *, int noargc, Scheme_Object **noargv);
static Scheme_Object *do_load(void *, int noargc, Scheme_Object **noargv);
static Scheme_Object *do_apply(void *, int noargc, Scheme_Object **noargv);
static void register_vim_exn(void);
static vim_mz_buffer *get_buffer_arg(const char *fname, int argnum,
int argc, Scheme_Object **argv);
@@ -1056,7 +1047,7 @@ mzscheme_init(void)
MZ_GC_REG();
config = scheme_config;
MZ_GC_CHECK();
/* recreate ports each call effectivelly clearing these ones */
/* recreate ports each call effectively clearing these ones */
curout = scheme_make_string_output_port();
MZ_GC_CHECK();
curerr = scheme_make_string_output_port();
@@ -1196,36 +1187,6 @@ ex_mzscheme(exarg_T *eap)
}
}
/*
* apply MzScheme procedure with arguments,
* handling errors
*/
Scheme_Object *
mzvim_apply(Scheme_Object *proc, int argc, Scheme_Object **argv)
{
if (mzscheme_init())
return FAIL;
else
{
Apply_Info data = {NULL, 0, NULL};
Scheme_Object *ret = NULL;
MZ_GC_DECL_REG(5);
MZ_GC_VAR_IN_REG(0, ret);
MZ_GC_VAR_IN_REG(1, data.proc);
MZ_GC_ARRAY_VAR_IN_REG(2, data.argv, argc);
MZ_GC_REG();
data.proc = proc;
data.argc = argc;
data.argv = argv;
eval_with_exn_handling(&data, do_apply, &ret);
MZ_GC_UNREG();
return ret;
}
}
static Scheme_Object *
do_load(void *data, int noargc, Scheme_Object **noargv)
{
@@ -1257,7 +1218,7 @@ do_load(void *data, int noargc, Scheme_Object **noargv)
MZ_GC_CHECK();
}
/* errors will be caught in do_mzscheme_comamnd and ex_mzfile */
/* errors will be caught in do_mzscheme_command and ex_mzfile */
scheme_close_input_port(pinfo->port);
MZ_GC_CHECK();
pinfo->port = NULL;
@@ -1348,13 +1309,6 @@ do_eval(void *s, int noargc, Scheme_Object **noargv)
return scheme_eval_string_all((char *)s, environment, TRUE);
}
static Scheme_Object *
do_apply(void *a, int noargc, Scheme_Object **noargv)
{
Apply_Info *info = (Apply_Info *)a;
return scheme_apply(info->proc, info->argc, info->argv);
}
/*
*========================================================================
* 3. MzScheme I/O Handlers
@@ -2128,7 +2082,7 @@ get_buffer_line_list(void *data, int argc, Scheme_Object **argv)
static Scheme_Object *
set_buffer_line(void *data, int argc, Scheme_Object **argv)
{
/* First of all, we check the the of the supplied MzScheme object.
/* First of all, we check the value of the supplied MzScheme object.
* There are three cases:
* 1. #f - this is a deletion.
* 2. A string - this is a replacement.
@@ -2428,7 +2382,7 @@ set_buffer_line_list(void *data, int argc, Scheme_Object **argv)
/*
* (insert-buff-line-list {linenr} {string/string-list} [buffer])
*
* Insert a number of lines into the specified buffer after the specifed line.
* Insert a number of lines into the specified buffer after the specified line.
* The line number is in Vim format (1-based). The lines to be inserted are
* given as an MzScheme list of string objects or as a single string. The lines
* to be added are checked for validity and correct format. Errors are

View File

@@ -78,7 +78,7 @@
/* Functions private to this file */
static void workshop_connection_closed(void);
static void messageFromEserve(XtPointer clientData, int *NOTUSED1, XtInputId *NOTUSED2);
static void messageFromEserve(XtPointer clientData, int *dum1, XtInputId *dum2);
static void workshop_disconnect(void);
static void workshop_sensitivity(int num, char *table);
static void adjust_sign_name(char *filename);
@@ -157,9 +157,10 @@ getCommand(void)
}
/*ARGSUSED*/
void
messageFromEserve(XtPointer clientData, int *NOTUSED1, XtInputId *NOTUSED2)
messageFromEserve(XtPointer clientData UNUSED,
int *dum1 UNUSED,
XtInputId *dum2 UNUSED)
{
char *cmd; /* the 1st word of the command */
@@ -199,7 +200,7 @@ messageFromEserve(XtPointer clientData, int *NOTUSED1, XtInputId *NOTUSED2)
if (sign) {
sign++;
}
/* Change sign name to accomodate a different size? */
/* Change sign name to accommodate a different size? */
adjust_sign_name(sign);
workshop_add_mark_type(idx, color, sign);
}
@@ -580,7 +581,7 @@ unrecognised_message(
#endif
/* Change sign name to accomodate a different size:
/* Change sign name to accommodate a different size:
* Create the filename based on the height. The filename format
* of multisize icons are:
* x.xpm : largest icon
@@ -614,6 +615,7 @@ adjust_sign_name(char *filename)
strcpy(s, ".xpm");
}
#if 0
/* Were we invoked by WorkShop? This function can be used early during startup
if you want to do things differently if the editor is started standalone
or in WorkShop mode. For example, in standalone mode you may not want to
@@ -627,6 +629,7 @@ workshop_invoked()
}
return result;
}
#endif
/* Connect back to eserve */
void workshop_connect(XtAppContext context)
@@ -750,6 +753,7 @@ void workshop_disconnect()
* Utility functions
*/
#if 0
/* Set icon for the window */
void
workshop_set_icon(Display *display, Widget shell, char **xpmdata,
@@ -793,6 +797,7 @@ workshop_set_icon(Display *display, Widget shell, char **xpmdata,
}
XtFree((char *)xpmAttributes.colorsymbols);
}
#endif
/* Minimize and maximize shells. From libutil's shell.cc. */
@@ -927,7 +932,7 @@ Boolean workshop_get_width_height(int *width, int *height)
return success;
}
#if 0
Boolean workshop_get_rows_cols(int *rows, int *cols)
{
static int r = 0;
@@ -958,6 +963,7 @@ Boolean workshop_get_rows_cols(int *rows, int *cols)
}
return success;
}
#endif
/*
* Toolbar code
@@ -1043,12 +1049,11 @@ void workshop_set_option_first(char *name, char *value)
}
#if 0
/*
* Send information to eserve on certain editor events
* You must make sure these are called when necessary
*/
void workshop_file_closed(char *filename)
{
char buffer[2*MAXPATHLEN];
@@ -1056,6 +1061,7 @@ void workshop_file_closed(char *filename)
NOCATGETS("deletedFile %s\n"), filename);
write(sd, buffer, strlen(buffer));
}
#endif
void workshop_file_closed_lineno(char *filename, int lineno)
{
@@ -1086,14 +1092,7 @@ void workshop_file_saved(char *filename)
workshop_moved_marks(filename);
}
void workshop_move_mark(char *filename, int markId, int newLineno)
{
char buffer[2*MAXPATHLEN];
vim_snprintf(buffer, sizeof(buffer),
NOCATGETS("moveMark %s %d %d\n"), filename, markId, newLineno);
write(sd, buffer, strlen(buffer));
}
#if 0
void workshop_file_modified(char *filename)
{
char buffer[2*MAXPATHLEN];
@@ -1102,6 +1101,15 @@ void workshop_file_modified(char *filename)
write(sd, buffer, strlen(buffer));
}
void workshop_move_mark(char *filename, int markId, int newLineno)
{
char buffer[2*MAXPATHLEN];
vim_snprintf(buffer, sizeof(buffer),
NOCATGETS("moveMark %s %d %d\n"), filename, markId, newLineno);
write(sd, buffer, strlen(buffer));
}
#endif
void workshop_frame_moved(int new_x, int new_y, int new_w, int new_h)
{
char buffer[200];
@@ -1179,10 +1187,12 @@ void workshop_perform_verb(char *verb, void *clientData)
}
/* Send a message to eserve */
#if defined(NOHANDS_SUPPORT_FUNCTIONS) || defined(FEAT_BEVAL)
void workshop_send_message(char *buf)
{
write(sd, buf, strlen(buf));
}
#endif
/* Some methods, like currentFile, cursorPos, etc. are missing here.
* But it looks like these are used for NoHands testing only so we

View File

@@ -366,14 +366,21 @@ main
* Check if the GUI can be started. Reset gui.starting if not.
* Don't know about other systems, stay on the safe side and don't check.
*/
if (gui.starting && gui_init_check() == FAIL)
if (gui.starting)
{
gui.starting = FALSE;
if (gui_init_check() == FAIL)
{
gui.starting = FALSE;
/* When running "evim" or "gvim -y" we need the menus, exit if we
* don't have them. */
if (params.evim_mode)
mch_exit(1);
/* When running "evim" or "gvim -y" we need the menus, exit if we
* don't have them. */
if (params.evim_mode)
mch_exit(1);
}
# if defined(HAVE_LOCALE_H) || defined(X_LOCALE)
/* Re-initialize locale, it may have been altered by gui_init_check() */
init_locale();
# endif
}
# endif
#endif
@@ -3685,7 +3692,7 @@ cmdsrv_main(argc, argv, serverName_arg, serverStr)
}
else if (STRICMP(argv[i], "--servername") == 0)
{
/* Alredy processed. Take it out of the command line */
/* Already processed. Take it out of the command line */
i++;
continue;
}

View File

@@ -133,21 +133,39 @@ static int dbcs_char2cells __ARGS((int c));
static int dbcs_ptr2cells_len __ARGS((char_u *p, int size));
static int dbcs_ptr2char __ARGS((char_u *p));
/* Lookup table to quickly get the length in bytes of a UTF-8 character from
* the first byte of a UTF-8 string. Bytes which are illegal when used as the
* first byte have a one, because these will be used separately. */
/*
* Lookup table to quickly get the length in bytes of a UTF-8 character from
* the first byte of a UTF-8 string.
* Bytes which are illegal when used as the first byte have a 1.
* The NUL byte has length 1.
*/
static char utf8len_tab[256] =
{
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /*bogus*/
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /*bogus*/
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,5,5,5,5,6,6,1,1,
};
/*
* Like utf8len_tab above, but using a zero for illegal lead bytes.
*/
static char utf8len_tab_zero[256] =
{
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,5,5,5,5,6,6,0,0,
};
/*
* XIM often causes trouble. Define XIM_DEBUG to get a log of XIM callbacks
* in the "xim.log" file.
@@ -1352,7 +1370,7 @@ utf_ptr2cells_len(p, size)
if (size > 0 && *p >= 0x80)
{
if (utf_ptr2len_len(p, size) < utf8len_tab[*p])
return 1;
return 1; /* truncated */
c = utf_ptr2char(p);
/* An illegal byte is displayed as <xx>. */
if (utf_ptr2len(p) == 1 || c == NUL)
@@ -1473,7 +1491,7 @@ utf_ptr2char(p)
if (p[0] < 0x80) /* be quick for ASCII */
return p[0];
len = utf8len_tab[p[0]];
len = utf8len_tab_zero[p[0]];
if (len > 1 && (p[1] & 0xc0) == 0x80)
{
if (len == 2)
@@ -1723,6 +1741,7 @@ utf_ptr2len(p)
/*
* Return length of UTF-8 character, obtained from the first byte.
* "b" must be between 0 and 255!
* Returns 1 for an invalid first byte value.
*/
int
utf_byte2len(b)
@@ -1737,6 +1756,7 @@ utf_byte2len(b)
* Returns 1 for "".
* Returns 1 for an illegal byte sequence (also in incomplete byte seq.).
* Returns number > "size" for an incomplete byte sequence.
* Never returns zero.
*/
int
utf_ptr2len_len(p, size)
@@ -1747,11 +1767,13 @@ utf_ptr2len_len(p, size)
int i;
int m;
if (*p == NUL)
return 1;
m = len = utf8len_tab[*p];
len = utf8len_tab[*p];
if (len == 1)
return 1; /* NUL, ascii or illegal lead byte */
if (len > size)
m = size; /* incomplete byte sequence. */
else
m = len;
for (i = 1; i < m; ++i)
if ((p[i] & 0xc0) != 0x80)
return 1;
@@ -2505,6 +2527,7 @@ show_utf8()
/*
* mb_head_off() function pointer.
* Return offset from "p" to the first byte of the character it points into.
* If "p" points to the NUL at the end of the string return 0.
* Returns 0 when already at the first byte of a character.
*/
int
@@ -2524,7 +2547,7 @@ dbcs_head_off(base, p)
/* It can't be a trailing byte when not using DBCS, at the start of the
* string or the previous byte can't start a double-byte. */
if (p <= base || MB_BYTE2LEN(p[-1]) == 1)
if (p <= base || MB_BYTE2LEN(p[-1]) == 1 || *p == NUL)
return 0;
/* This is slow: need to start at the base and go forward until the
@@ -2552,7 +2575,8 @@ dbcs_screen_head_off(base, p)
* lead byte in the current cell. */
if (p <= base
|| (enc_dbcs == DBCS_JPNU && p[-1] == 0x8e)
|| MB_BYTE2LEN(p[-1]) == 1)
|| MB_BYTE2LEN(p[-1]) == 1
|| *p == NUL)
return 0;
/* This is slow: need to start at the base and go forward until the
@@ -2578,6 +2602,7 @@ utf_head_off(base, p)
char_u *q;
char_u *s;
int c;
int len;
#ifdef FEAT_ARABIC
char_u *j;
#endif
@@ -2597,8 +2622,8 @@ utf_head_off(base, p)
--q;
/* Check for illegal sequence. Do allow an illegal byte after where we
* started. */
if (utf8len_tab[*q] != (int)(s - q + 1)
&& utf8len_tab[*q] != (int)(p - q + 1))
len = utf8len_tab[*q];
if (len != (int)(s - q + 1) && len != (int)(p - q + 1))
return 0;
if (q <= base)
@@ -2810,9 +2835,9 @@ utf_valid_string(s, end)
while (end == NULL ? *p != NUL : p < end)
{
if ((*p & 0xc0) == 0x80)
l = utf8len_tab_zero[*p];
if (l == 0)
return FALSE; /* invalid lead byte */
l = utf8len_tab[*p];
if (end != NULL && p + l > end)
return FALSE; /* incomplete byte sequence */
++p;
@@ -6117,12 +6142,20 @@ string_convert_ext(vcp, ptr, lenp, unconvlenp)
d = retval;
for (i = 0; i < len; ++i)
{
l = utf_ptr2len(ptr + i);
l = utf_ptr2len_len(ptr + i, len - i);
if (l == 0)
*d++ = NUL;
else if (l == 1)
{
if (unconvlenp != NULL && utf8len_tab[ptr[i]] > len - i)
int l_w = utf8len_tab_zero[ptr[i]];
if (l_w == 0)
{
/* Illegal utf-8 byte cannot be converted */
vim_free(retval);
return NULL;
}
if (unconvlenp != NULL && l_w > len - i)
{
/* Incomplete sequence at the end. */
*unconvlenp = len - i;

View File

@@ -3470,7 +3470,9 @@ init_homedir()
homedrive = mch_getenv((char_u *)"HOMEDRIVE");
homepath = mch_getenv((char_u *)"HOMEPATH");
if (homedrive != NULL && homepath != NULL
if (homepath == NULL || *homepath == NUL)
homepath = "\\";
if (homedrive != NULL
&& STRLEN(homedrive) + STRLEN(homepath) < MAXPATHL)
{
sprintf((char *)NameBuff, "%s%s", homedrive, homepath);
@@ -4666,7 +4668,6 @@ concat_fnames(fname1, fname2, sep)
return dest;
}
#if defined(FEAT_EVAL) || defined(FEAT_GETTEXT) || defined(PROTO)
/*
* Concatenate two strings and return the result in allocated memory.
* Returns NULL when out of memory.
@@ -4687,7 +4688,6 @@ concat_str(str1, str2)
}
return dest;
}
#endif
/*
* Add a path separator to a file name, unless it already ends in a path
@@ -8446,6 +8446,46 @@ fast_breakcheck()
}
}
/*
* Invoke expand_wildcards() for one pattern.
* Expand items like "%:h" before the expansion.
* Returns OK or FAIL.
*/
int
expand_wildcards_eval(pat, num_file, file, flags)
char_u **pat; /* pointer to input pattern */
int *num_file; /* resulting number of files */
char_u ***file; /* array of resulting files */
int flags; /* EW_DIR, etc. */
{
int ret = FAIL;
char_u *eval_pat = NULL;
char_u *exp_pat = *pat;
char_u *ignored_msg;
int usedlen;
if (*exp_pat == '%' || *exp_pat == '#' || *exp_pat == '<')
{
++emsg_off;
eval_pat = eval_vars(exp_pat, exp_pat, &usedlen,
NULL, &ignored_msg, NULL);
--emsg_off;
if (eval_pat != NULL)
exp_pat = concat_str(eval_pat, exp_pat + usedlen);
}
if (exp_pat != NULL)
ret = expand_wildcards(1, &exp_pat, num_file, file, flags);
if (eval_pat != NULL)
{
vim_free(exp_pat);
vim_free(eval_pat);
}
return ret;
}
/*
* Expand wildcards. Calls gen_expand_wildcards() and removes files matching
* 'wildignore'.

View File

@@ -528,6 +528,8 @@ check_cursor_col()
#endif
}
}
else if (curwin->w_cursor.col < 0)
curwin->w_cursor.col = 0;
#ifdef FEAT_VIRTUALEDIT
/* If virtual editing is on, we can leave the cursor on the old position,
@@ -1390,6 +1392,7 @@ vim_strsave_shellescape(string, do_special)
*d++ = '\\'; /* insert backslash */
while (--l >= 0) /* copy the var */
*d++ = *p++;
continue;
}
MB_COPY_CHAR(p, d);

View File

@@ -5602,6 +5602,7 @@ nv_ident(cap)
STRCAT(buf, "\\>");
#ifdef FEAT_CMDHIST
/* put pattern in search history */
init_history();
add_to_history(HIST_SEARCH, buf, TRUE, NUL);
#endif
normal_search(cap, cmdchar == '*' ? '/' : '?', buf, 0);

View File

@@ -13,8 +13,6 @@ win_T *get_valid_window __ARGS((void *));
void mzvim_check_threads __ARGS((void));
void mzvim_reset_timer __ARGS((void));
void *mzvim_eval_string __ARGS((char_u *str));
struct Scheme_Object *mzvim_apply __ARGS((struct Scheme_Object *, int argc,
struct Scheme_Object **));
int mzthreads_allowed __ARGS((void));
void mzscheme_main __ARGS((void));
/* vim: set ft=c : */

View File

@@ -85,6 +85,7 @@ void preserve_exit __ARGS((void));
int vim_fexists __ARGS((char_u *fname));
void line_breakcheck __ARGS((void));
void fast_breakcheck __ARGS((void));
int expand_wildcards_eval __ARGS((char_u **pat, int *num_file, char_u ***file, int flags));
int expand_wildcards __ARGS((int num_pat, char_u **pat, int *num_file, char_u ***file, int flags));
int match_suffix __ARGS((char_u *fname));
int unix_expandpath __ARGS((garray_T *gap, char_u *path, int wildoff, int flags, int didstar));

View File

@@ -583,6 +583,7 @@ static int re_has_z; /* \z item detected */
#endif
static char_u *regcode; /* Code-emit pointer, or JUST_CALC_SIZE */
static long regsize; /* Code size. */
static int reg_toolong; /* TRUE when offset out of range */
static char_u had_endbrace[NSUBEXP]; /* flags, TRUE if end of () found */
static unsigned regflags; /* RF_ flags for prog */
static long brace_min[10]; /* Minimums for complex brace repeats */
@@ -1028,9 +1029,11 @@ vim_regcomp(expr, re_flags)
regcomp_start(expr, re_flags);
regcode = r->program;
regc(REGMAGIC);
if (reg(REG_NOPAREN, &flags) == NULL)
if (reg(REG_NOPAREN, &flags) == NULL || reg_toolong)
{
vim_free(r);
if (reg_toolong)
EMSG_RET_NULL(_("E339: Pattern too long"));
return NULL;
}
@@ -1141,6 +1144,7 @@ regcomp_start(expr, re_flags)
re_has_z = 0;
#endif
regsize = 0L;
reg_toolong = FALSE;
regflags = 0;
#if defined(FEAT_SYN_HL) || defined(PROTO)
had_eol = FALSE;
@@ -1228,7 +1232,7 @@ reg(paren, flagp)
{
skipchr();
br = regbranch(&flags);
if (br == NULL)
if (br == NULL || reg_toolong)
return NULL;
regtail(ret, br); /* BRANCH -> BRANCH. */
if (!(flags & HASWIDTH))
@@ -1313,6 +1317,8 @@ regbranch(flagp)
break;
skipchr();
regtail(latest, regnode(END)); /* operand ends */
if (reg_toolong)
break;
reginsert(MATCH, latest);
chain = latest;
}
@@ -1382,7 +1388,7 @@ regconcat(flagp)
break;
default:
latest = regpiece(&flags);
if (latest == NULL)
if (latest == NULL || reg_toolong)
return NULL;
*flagp |= flags & (HASWIDTH | HASNL | HASLOOKBH);
if (chain == NULL) /* First piece. */
@@ -2540,8 +2546,16 @@ regtail(p, val)
offset = (int)(scan - val);
else
offset = (int)(val - scan);
*(scan + 1) = (char_u) (((unsigned)offset >> 8) & 0377);
*(scan + 2) = (char_u) (offset & 0377);
/* When the offset uses more than 16 bits it can no longer fit in the two
* bytes avaliable. Use a global flag to avoid having to check return
* values in too many places. */
if (offset > 0xffff)
reg_toolong = TRUE;
else
{
*(scan + 1) = (char_u) (((unsigned)offset >> 8) & 0377);
*(scan + 2) = (char_u) (offset & 0377);
}
}
/*
@@ -5764,6 +5778,8 @@ do_class:
/*
* regnext - dig the "next" pointer out of a node
* Returns NULL when calculating size, when there is no next item and when
* there is an error.
*/
static char_u *
regnext(p)
@@ -5771,7 +5787,7 @@ regnext(p)
{
int offset;
if (p == JUST_CALC_SIZE)
if (p == JUST_CALC_SIZE || reg_toolong)
return NULL;
offset = NEXT(p);
@@ -6812,6 +6828,8 @@ static int can_f_submatch = FALSE; /* TRUE when submatch() can be used */
* that contains a call to substitute() and submatch(). */
static regmatch_T *submatch_match;
static regmmatch_T *submatch_mmatch;
static linenr_T submatch_firstlnum;
static linenr_T submatch_maxline;
#endif
#if defined(FEAT_MODIFY_FNAME) || defined(FEAT_EVAL) || defined(PROTO)
@@ -6925,7 +6943,6 @@ vim_regsub_both(source, dest, copy, magic, backslash)
}
else
{
linenr_T save_reg_maxline;
win_T *save_reg_win;
int save_ireg_ic;
@@ -6937,7 +6954,8 @@ vim_regsub_both(source, dest, copy, magic, backslash)
* vim_regexec_multi() can't be called recursively. */
submatch_match = reg_match;
submatch_mmatch = reg_mmatch;
save_reg_maxline = reg_maxline;
submatch_firstlnum = reg_firstlnum;
submatch_maxline = reg_maxline;
save_reg_win = reg_win;
save_ireg_ic = ireg_ic;
can_f_submatch = TRUE;
@@ -6960,7 +6978,8 @@ vim_regsub_both(source, dest, copy, magic, backslash)
reg_match = submatch_match;
reg_mmatch = submatch_mmatch;
reg_maxline = save_reg_maxline;
reg_firstlnum = submatch_firstlnum;
reg_maxline = submatch_maxline;
reg_win = save_reg_win;
ireg_ic = save_ireg_ic;
can_f_submatch = FALSE;
@@ -7195,6 +7214,31 @@ exit:
}
#ifdef FEAT_EVAL
static char_u *reg_getline_submatch __ARGS((linenr_T lnum));
/*
* Call reg_getline() with the line numbers from the submatch. If a
* substitute() was used the reg_maxline and other values have been
* overwritten.
*/
static char_u *
reg_getline_submatch(lnum)
linenr_T lnum;
{
char_u *s;
linenr_T save_first = reg_firstlnum;
linenr_T save_max = reg_maxline;
reg_firstlnum = submatch_firstlnum;
reg_maxline = submatch_maxline;
s = reg_getline(lnum);
reg_firstlnum = save_first;
reg_maxline = save_max;
return s;
}
/*
* Used for the submatch() function: get the string from the n'th submatch in
* allocated memory.
@@ -7225,7 +7269,7 @@ reg_submatch(no)
if (lnum < 0 || submatch_mmatch->endpos[no].lnum < 0)
return NULL;
s = reg_getline(lnum) + submatch_mmatch->startpos[no].col;
s = reg_getline_submatch(lnum) + submatch_mmatch->startpos[no].col;
if (s == NULL) /* anti-crash check, cannot happen? */
break;
if (submatch_mmatch->endpos[no].lnum == lnum)
@@ -7251,7 +7295,7 @@ reg_submatch(no)
++lnum;
while (lnum < submatch_mmatch->endpos[no].lnum)
{
s = reg_getline(lnum++);
s = reg_getline_submatch(lnum++);
if (round == 2)
STRCPY(retval + len, s);
len += (int)STRLEN(s);
@@ -7260,7 +7304,7 @@ reg_submatch(no)
++len;
}
if (round == 2)
STRNCPY(retval + len, reg_getline(lnum),
STRNCPY(retval + len, reg_getline_submatch(lnum),
submatch_mmatch->endpos[no].col);
len += submatch_mmatch->endpos[no].col;
if (round == 2)

View File

@@ -323,6 +323,7 @@ update_screen(type)
int did_one;
#endif
/* Don't do anything if the screen structures are (not yet) valid. */
if (!screen_valid(TRUE))
return;
@@ -342,7 +343,9 @@ update_screen(type)
if (curwin->w_lines_valid == 0 && type < NOT_VALID)
type = NOT_VALID;
if (!redrawing())
/* Postpone the redrawing when it's not needed and when being called
* recursively. */
if (!redrawing() || updating_screen)
{
redraw_later(type); /* remember type for next time */
must_redraw = type;
@@ -582,6 +585,7 @@ static void update_finish __ARGS((void));
/*
* Prepare for updating one or more windows.
* Caller must check for "updating_screen" already set to avoid recursiveness.
*/
static void
update_prepare()
@@ -663,7 +667,9 @@ update_debug_sign(buf, lnum)
doit = TRUE;
}
if (!doit)
/* Return when there is nothing to do or screen updating already
* happening. */
if (!doit || updating_screen)
return;
/* update all windows that need updating */
@@ -696,6 +702,10 @@ update_debug_sign(buf, lnum)
updateWindow(wp)
win_T *wp;
{
/* return if already busy updating */
if (updating_screen)
return;
update_prepare();
#ifdef FEAT_CLIPBOARD

View File

@@ -206,7 +206,7 @@ typedef struct syn_pattern
static int current_attr = 0; /* attr of current syntax word */
#ifdef FEAT_EVAL
static int current_id = 0; /* ID of current char for syn_get_id() */
static int current_trans_id = 0; /* idem, transparancy removed */
static int current_trans_id = 0; /* idem, transparency removed */
#endif
typedef struct syn_cluster_S
@@ -282,7 +282,7 @@ typedef struct state_item
int si_idx; /* index of syntax pattern or
KEYWORD_IDX */
int si_id; /* highlight group ID for keywords */
int si_trans_id; /* idem, transparancy removed */
int si_trans_id; /* idem, transparency removed */
int si_m_lnum; /* lnum of the match */
int si_m_startcol; /* starting column of the match */
lpos_T si_m_endpos; /* just after end posn of the match */
@@ -1274,7 +1274,7 @@ syn_stack_cleanup()
dist = syn_buf->b_ml.ml_line_count / (syn_buf->b_sst_len - Rows) + 1;
/*
* Go throught the list to find the "tick" for the oldest entry that can
* Go through the list to find the "tick" for the oldest entry that can
* be removed. Set "above" when the "tick" for the oldest entry is above
* "b_sst_lasttick" (the display tick wraps around).
*/
@@ -2319,7 +2319,7 @@ syn_current_attr(syncing, displaying, can_spell, keep_state)
? (syn_buf->b_spell_cluster_id == 0)
: (syn_buf->b_syn_spell == SYNSPL_TOP);
/* nextgroup ends at end of line, unless "skipnl" or "skipemtpy" present */
/* nextgroup ends at end of line, unless "skipnl" or "skipempty" present */
if (current_next_list != NULL
&& syn_getcurline()[current_col + 1] == NUL
&& !(current_next_flags & (HL_SKIPNL | HL_SKIPEMPTY)))
@@ -6108,7 +6108,7 @@ syn_get_id(wp, lnum, col, trans, spellp, keep_state)
win_T *wp;
long lnum;
colnr_T col;
int trans; /* remove transparancy */
int trans; /* remove transparency */
int *spellp; /* return: can do spell checking */
int keep_state; /* keep state of char at "col" */
{
@@ -7523,7 +7523,7 @@ highlight_clear(idx)
#if defined(FEAT_GUI) || defined(PROTO)
/*
* Set the normal foreground and background colors according to the "Normal"
* highlighighting group. For X11 also set "Menu", "Scrollbar", and
* highlighting group. For X11 also set "Menu", "Scrollbar", and
* "Tooltip" colors.
*/
void
@@ -8647,6 +8647,7 @@ syn_add_group(name)
if (!vim_isprintc(*p))
{
EMSG(_("E669: Unprintable character in group name"));
vim_free(name);
return 0;
}
else if (!ASCII_ISALNUM(*p) && *p != '_')

View File

@@ -681,6 +681,52 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
327,
/**/
326,
/**/
325,
/**/
324,
/**/
323,
/**/
322,
/**/
321,
/**/
320,
/**/
319,
/**/
318,
/**/
317,
/**/
316,
/**/
315,
/**/
314,
/**/
313,
/**/
312,
/**/
311,
/**/
310,
/**/
309,
/**/
308,
/**/
307,
/**/
306,
/**/
305,
/**/
304,
/**/

View File

@@ -56,12 +56,12 @@ static void load_buffer_by_number(int, int);
static void load_window(char *, int lnum);
static void warp_to_pc(int);
#ifdef FEAT_BEVAL
void workshop_beval_cb(BalloonEval *, int);
void workshop_beval_cb(BalloonEval *, int);
static int computeIndex(int, char_u *, int);
#endif
static char *fixAccelText(char *);
static void addMenu(char *, char *, char *);
static char *lookupVerb(char *, int);
static int computeIndex(int, char_u *, int);
static void coloncmd(char *, Boolean);
extern Widget vimShell;
@@ -1624,8 +1624,6 @@ workshop_beval_cb(
}
}
}
#endif
static int
computeIndex(
@@ -1649,6 +1647,7 @@ computeIndex(
return -1;
}
#endif
static void
addMenu(