From 540cef1df26b1524770e96dfc3431902d14b4fbd Mon Sep 17 00:00:00 2001 From: edyfox Date: Wed, 10 Mar 2010 11:32:06 +0000 Subject: [PATCH] Merged from the latest developing branch. git-svn-id: https://vim.svn.sourceforge.net/svnroot/vim/trunk@1790 2a77ed30-b011-0410-a7ad-c7884a0aa172 --- src/Make_ming.mak | 3 +-- src/Make_mvc.mak | 3 +++ src/ex_cmds2.c | 4 +--- src/ex_docmd.c | 35 ++++++++++++++++++++++++++++------- src/ex_getln.c | 7 ++++++- src/fileio.c | 5 ++++- src/if_perl.xs | 11 ++++++++--- src/if_python.c | 2 +- src/misc1.c | 7 +++++-- src/proto/ex_docmd.pro | 1 + src/syntax.c | 2 +- src/testdir/Make_dos.mak | 1 + src/ui.c | 9 +-------- src/version.c | 18 ++++++++++++++++++ src/vim.h | 7 ++++--- 15 files changed, 83 insertions(+), 32 deletions(-) diff --git a/src/Make_ming.mak b/src/Make_ming.mak index ca630de8..f57fb18d 100644 --- a/src/Make_ming.mak +++ b/src/Make_ming.mak @@ -248,8 +248,8 @@ MKDIR = mkdir -p DIRSLASH = / else # normal (Windows) compilation: -ifneq (sh.exe, $(SHELL)) CROSS_COMPILE = +ifneq (sh.exe, $(SHELL)) DEL = rm MKDIR = mkdir -p DIRSLASH = / @@ -553,7 +553,6 @@ xxd/xxd.exe: xxd/xxd.c $(MAKE) -C xxd -f Make_cyg.mak CC=$(CC) GvimExt/gvimext.dll: GvimExt/gvimext.cpp GvimExt/gvimext.rc GvimExt/gvimext.h - $(MAKE) -C GvimExt -f Make_ming.mak $(MAKE) -C GvimExt -f Make_ming.mak CROSS=$(CROSS) CROSS_COMPILE=$(CROSS_COMPILE) clean: diff --git a/src/Make_mvc.mak b/src/Make_mvc.mak index 15a14ade..38ced6e5 100644 --- a/src/Make_mvc.mak +++ b/src/Make_mvc.mak @@ -361,6 +361,9 @@ MSVCVER = 9.0 !if "$(_NMAKE_VER)" == "10.00.20506.01" MSVCVER = 10.0 !endif +!if "$(_NMAKE_VER)" == "10.00.30128.01" +MSVCVER = 10.0 +!endif !endif # Abort bulding VIM if version of VC is unrecognised. diff --git a/src/ex_cmds2.c b/src/ex_cmds2.c index 0fcb6c7a..92451b5e 100644 --- a/src/ex_cmds2.c +++ b/src/ex_cmds2.c @@ -1165,7 +1165,6 @@ set_context_in_profile_cmd(xp, arg) char_u *arg; { char_u *end_subcmd; - int len; /* Default: expand subcommands. */ xp->xp_context = EXPAND_PROFILE; @@ -1176,8 +1175,7 @@ set_context_in_profile_cmd(xp, arg) if (*end_subcmd == NUL) return; - len = end_subcmd - arg; - if (len == 5 && STRNCMP(arg, "start", 5) == 0) + if (end_subcmd - arg == 5 && STRNCMP(arg, "start", 5) == 0) { xp->xp_context = EXPAND_FILES; xp->xp_pattern = skipwhite(end_subcmd); diff --git a/src/ex_docmd.c b/src/ex_docmd.c index aeb7774b..f8795fa1 100644 --- a/src/ex_docmd.c +++ b/src/ex_docmd.c @@ -26,10 +26,12 @@ typedef struct ucmd long_u uc_argt; /* The argument type */ char_u *uc_rep; /* The command's replacement string */ long uc_def; /* The default value for a range/count */ - scid_T uc_scriptID; /* SID where the command was defined */ int uc_compl; /* completion type */ -# if defined(FEAT_EVAL) && defined(FEAT_CMDL_COMPL) +# ifdef FEAT_EVAL + scid_T uc_scriptID; /* SID where the command was defined */ +# ifdef FEAT_CMDL_COMPL char_u *uc_compl_arg; /* completion argument if any */ +# endif # endif } ucmd_T; @@ -3156,17 +3158,15 @@ set_one_cmd_context(xp, buff) return NULL; } for (ea.cmdidx = (cmdidx_T)0; (int)ea.cmdidx < (int)CMD_SIZE; - ea.cmdidx = (cmdidx_T)((int)ea.cmdidx + 1)) - if (STRNCMP(cmdnames[(int)ea.cmdidx].cmd_name, cmd, (size_t)len) == 0) + ea.cmdidx = (cmdidx_T)((int)ea.cmdidx + 1)) + if (STRNCMP(cmdnames[(int)ea.cmdidx].cmd_name, cmd, + (size_t)len) == 0) break; #ifdef FEAT_USR_CMDS if (cmd[0] >= 'A' && cmd[0] <= 'Z') - { while (ASCII_ISALNUM(*p) || *p == '*') /* Allow * wild card */ ++p; - len = (int)(p - cmd); - } #endif } @@ -3809,6 +3809,9 @@ set_one_cmd_context(xp, buff) set_context_in_profile_cmd(xp, arg); break; #endif + case CMD_behave: + xp->xp_context = EXPAND_BEHAVE; + break; #endif /* FEAT_CMDL_COMPL */ @@ -10847,6 +10850,24 @@ ex_behave(eap) EMSG2(_(e_invarg2), eap->arg); } +#if defined(FEAT_CMDL_COMPL) || defined(PROTO) +/* + * Function given to ExpandGeneric() to obtain the possible arguments of the + * ":behave {mswin,xterm}" command. + */ + char_u * +get_behave_arg(xp, idx) + expand_T *xp UNUSED; + int idx; +{ + if (idx == 0) + return (char_u *)"mswin"; + if (idx == 1) + return (char_u *)"xterm"; + return NULL; +} +#endif + #ifdef FEAT_AUTOCMD static int filetype_detect = FALSE; static int filetype_plugin = FALSE; diff --git a/src/ex_getln.c b/src/ex_getln.c index e8056f84..0f0f1707 100644 --- a/src/ex_getln.c +++ b/src/ex_getln.c @@ -4492,6 +4492,7 @@ ExpandFromContext(xp, pat, num_file, file, options) } tab[] = { {EXPAND_COMMANDS, get_command_name, FALSE}, + {EXPAND_BEHAVE, get_behave_arg, TRUE}, #ifdef FEAT_USR_CMDS {EXPAND_USER_COMMANDS, get_user_commands, FALSE}, {EXPAND_USER_CMD_FLAGS, get_user_cmd_flags, FALSE}, @@ -6251,7 +6252,11 @@ ex_window() bp = curbuf; win_goto(old_curwin); win_close(wp, TRUE); - close_buffer(NULL, bp, DOBUF_WIPE); + + /* win_close() may have already wiped the buffer when 'bh' is + * set to 'wipe' */ + if (buf_valid(bp)) + close_buffer(NULL, bp, DOBUF_WIPE); /* Restore window sizes. */ win_size_restore(&winsizes); diff --git a/src/fileio.c b/src/fileio.c index 0e2d1cca..88188e59 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -7925,7 +7925,10 @@ au_event_disable(what) new_ei = vim_strnsave(p_ei, (int)(STRLEN(p_ei) + STRLEN(what))); if (new_ei != NULL) { - STRCAT(new_ei, what); + if (*what == ',' && *p_ei == NUL) + STRCPY(new_ei, what + 1); + else + STRCAT(new_ei, what); set_string_option_direct((char_u *)"ei", -1, new_ei, OPT_FREE, SID_NONE); vim_free(new_ei); diff --git a/src/if_perl.xs b/src/if_perl.xs index 97847079..5c0c8ead 100644 --- a/src/if_perl.xs +++ b/src/if_perl.xs @@ -62,6 +62,11 @@ # define PERL589_OR_LATER #endif +#if (PERL_REVISION == 5) && ((PERL_VERSION > 10) || \ + (PERL_VERSION == 10) && (PERL_SUBVERSION >= 1)) +# define PERL5101_OR_LATER +#endif + #ifndef pTHX # define pTHX void # define pTHX_ @@ -93,7 +98,7 @@ EXTERN_C void boot_DynaLoader __ARGS((pTHX_ CV*)); # define perl_free dll_perl_free # define Perl_get_context dll_Perl_get_context # define Perl_croak dll_Perl_croak -# if (PERL_REVISION == 5) && (PERL_VERSION >= 10) +# ifdef PERL5101_OR_LATER # define Perl_croak_xs_usage dll_Perl_croak_xs_usage # endif # ifndef PROTO @@ -205,7 +210,7 @@ static int (*perl_run)(PerlInterpreter*); static int (*perl_parse)(PerlInterpreter*, XSINIT_t, int, char**, char**); static void* (*Perl_get_context)(void); static void (*Perl_croak)(pTHX_ const char*, ...); -#if (PERL_REVISION == 5) && (PERL_VERSION >= 10) +#ifdef PERL5101_OR_LATER static void (*Perl_croak_xs_usage)(pTHX_ const CV *const, const char *const params); #endif static void (*Perl_croak_nocontext)(const char*, ...); @@ -312,7 +317,7 @@ static struct { {"perl_parse", (PERL_PROC*)&perl_parse}, {"Perl_get_context", (PERL_PROC*)&Perl_get_context}, {"Perl_croak", (PERL_PROC*)&Perl_croak}, -#if (PERL_REVISION == 5) && (PERL_VERSION >= 10) +#ifdef PERL5101_OR_LATER {"Perl_croak_xs_usage", (PERL_PROC*)&Perl_croak_xs_usage}, #endif {"Perl_croak_nocontext", (PERL_PROC*)&Perl_croak_nocontext}, diff --git a/src/if_python.c b/src/if_python.c index c9ebf131..4f23ffa8 100644 --- a/src/if_python.c +++ b/src/if_python.c @@ -2080,7 +2080,7 @@ WindowSetattr(PyObject *self, char *name, PyObject *val) return -1; /* When column is out of range silently correct it. */ - len = STRLEN(ml_get_buf(this->win->w_buffer, lnum, FALSE)); + len = (long)STRLEN(ml_get_buf(this->win->w_buffer, lnum, FALSE)); if (col > len) col = len; diff --git a/src/misc1.c b/src/misc1.c index 6b6f3399..f67f9c6a 100644 --- a/src/misc1.c +++ b/src/misc1.c @@ -7727,11 +7727,14 @@ term_again: /* * If the NEXT line is a function declaration, the current * line needs to be indented as a function type spec. - * Don't do this if the current line looks like a comment - * or if the current line is terminated, ie. ends in ';'. + * Don't do this if the current line looks like a comment or if the + * current line is terminated, ie. ends in ';', or if the current line + * contains { or }: "void f() {\n if (1)" */ else if (cur_curpos.lnum < curbuf->b_ml.ml_line_count && !cin_nocode(theline) + && vim_strchr(theline, '{') == NULL + && vim_strchr(theline, '}') == NULL && !cin_ends_in(theline, (char_u *)":", NULL) && !cin_ends_in(theline, (char_u *)",", NULL) && cin_isfuncdecl(NULL, cur_curpos.lnum + 1) diff --git a/src/proto/ex_docmd.pro b/src/proto/ex_docmd.pro index e267acfd..8b0bd7c7 100644 --- a/src/proto/ex_docmd.pro +++ b/src/proto/ex_docmd.pro @@ -52,4 +52,5 @@ char_u *expand_sfile __ARGS((char_u *arg)); int put_eol __ARGS((FILE *fd)); int put_line __ARGS((FILE *fd, char *s)); void dialog_msg __ARGS((char_u *buff, char *format, char_u *fname)); +char_u *get_behave_arg __ARGS((expand_T *xp, int idx)); /* vim: set ft=c : */ diff --git a/src/syntax.c b/src/syntax.c index 355d41ce..8d976ea4 100644 --- a/src/syntax.c +++ b/src/syntax.c @@ -3090,7 +3090,7 @@ syn_add_start_off(result, regmatch, spp, idx, extra) { /* a "\n" at the end of the pattern may take us below the last line */ result->lnum = syn_buf->b_ml.ml_line_count; - col = STRLEN(ml_get_buf(syn_buf, result->lnum, FALSE)); + col = (int)STRLEN(ml_get_buf(syn_buf, result->lnum, FALSE)); } if (off != 0) { diff --git a/src/testdir/Make_dos.mak b/src/testdir/Make_dos.mak index 29f8b868..8f35c7bd 100644 --- a/src/testdir/Make_dos.mak +++ b/src/testdir/Make_dos.mak @@ -56,6 +56,7 @@ clean: -if exist small.vim del small.vim -if exist tiny.vim del tiny.vim -if exist mbyte.vim del mbyte.vim + -if exist mzscheme.vim del mzscheme.vim -del X* -if exist viminfo del viminfo diff --git a/src/ui.c b/src/ui.c index e9d6beba..8bafa155 100644 --- a/src/ui.c +++ b/src/ui.c @@ -2598,14 +2598,7 @@ retnomove: if (cmdwin_type != 0 && wp != curwin) { /* A click outside the command-line window: Use modeless - * selection if possible. Allow dragging the status line of - * windows just above the command-line window. */ - if (wp->w_winrow + wp->w_height - != curwin->w_prev->w_winrow + curwin->w_prev->w_height) - { - on_status_line = 0; - dragwin = NULL; - } + * selection if possible. Allow dragging the status lines. */ # ifdef FEAT_VERTSPLIT on_sep_line = 0; # endif diff --git a/src/version.c b/src/version.c index 1eff44f1..b4f67367 100644 --- a/src/version.c +++ b/src/version.c @@ -682,6 +682,24 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 385, +/**/ + 384, +/**/ + 383, +/**/ + 382, +/**/ + 381, +/**/ + 380, +/**/ + 379, +/**/ + 378, +/**/ + 377, +/**/ 376, /**/ 375, diff --git a/src/vim.h b/src/vim.h index 13f00ce9..d22227cf 100644 --- a/src/vim.h +++ b/src/vim.h @@ -595,7 +595,7 @@ extern char *(*dyn_libintl_textdomain)(const char *domainname); /* * Terminal highlighting attribute bits. - * Attibutes above HL_ALL are used for syntax highlighting. + * Attributes above HL_ALL are used for syntax highlighting. */ #define HL_NORMAL 0x00 #define HL_INVERSE 0x01 @@ -721,6 +721,7 @@ extern char *(*dyn_libintl_textdomain)(const char *domainname); #define EXPAND_CSCOPE 33 #define EXPAND_SIGN 34 #define EXPAND_PROFILE 35 +#define EXPAND_BEHAVE 36 /* Values for exmode_active (0 is no exmode) */ #define EXMODE_NORMAL 1 @@ -1262,7 +1263,7 @@ typedef enum } hlf_T; /* The HL_FLAGS must be in the same order as the HLF_ enums! - * When chainging this also adjust the default for 'highlight'. */ + * When changing this also adjust the default for 'highlight'. */ #define HL_FLAGS {'8', '@', 'd', 'e', 'h', 'i', 'l', 'm', 'M', \ 'n', 'r', 's', 'S', 'c', 't', 'v', 'V', 'w', 'W', \ 'f', 'F', 'A', 'C', 'D', 'T', '>', \ @@ -1430,7 +1431,7 @@ typedef enum #ifdef FEAT_MBYTE /* We need to call mb_stricmp() even when we aren't dealing with a multi-byte * encoding because mb_stricmp() takes care of all ascii and non-ascii - * encodings, including characters with umluats in latin1, etc., while + * encodings, including characters with umlauts in latin1, etc., while * STRICMP() only handles the system locale version, which often does not * handle non-ascii properly. */ -- 2.11.4.GIT