diff options
author | Bram Moolenaar <Bram@vim.org> | 2006-04-13 20:37:35 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2006-04-13 20:37:35 +0000 |
commit | 7fc904b610d5739dd7b72fb2f6b0e4b330c97179 (patch) | |
tree | a7ea75d0ab26a753f13949e25e08e2c875b37d69 /src | |
parent | 18144c84231aee36ae1d11b74941c9b318f1706a (diff) | |
download | vim-git-7fc904b610d5739dd7b72fb2f6b0e4b330c97179.tar.gz |
updated for version 7.0d03v7.0d03
Diffstat (limited to 'src')
-rw-r--r-- | src/diff.c | 12 | ||||
-rw-r--r-- | src/edit.c | 20 | ||||
-rw-r--r-- | src/ex_getln.c | 5 | ||||
-rw-r--r-- | src/misc1.c | 157 | ||||
-rw-r--r-- | src/option.c | 8 | ||||
-rw-r--r-- | src/os_mswin.c | 21 | ||||
-rw-r--r-- | src/testdir/test3.in | 39 | ||||
-rw-r--r-- | src/testdir/test3.ok | 39 | ||||
-rw-r--r-- | src/version.h | 6 |
9 files changed, 219 insertions, 88 deletions
diff --git a/src/diff.c b/src/diff.c index bc0364c77..4896c049a 100644 --- a/src/diff.c +++ b/src/diff.c @@ -839,7 +839,13 @@ diff_file(tmp_orig, tmp_new, tmp_diff) (diff_flags & DIFF_ICASE) ? "-i " : "", tmp_orig, tmp_new); append_redir(cmd, p_srr, tmp_diff); +#ifdef FEAT_AUTOCMD + ++autocmd_block; /* Avoid ShellCmdPost stuff */ +#endif (void)call_shell(cmd, SHELL_FILTER|SHELL_SILENT|SHELL_DOOUT); +#ifdef FEAT_AUTOCMD + --autocmd_block; +#endif vim_free(cmd); } } @@ -942,7 +948,13 @@ ex_diffpatch(eap) fullname != NULL ? fullname : # endif eap->arg); +#ifdef FEAT_AUTOCMD + ++autocmd_block; /* Avoid ShellCmdPost stuff */ +#endif (void)call_shell(buf, SHELL_FILTER | SHELL_COOKED); +#ifdef FEAT_AUTOCMD + --autocmd_block; +#endif } #ifdef UNIX diff --git a/src/edit.c b/src/edit.c index f2a5cdacd..a57787a98 100644 --- a/src/edit.c +++ b/src/edit.c @@ -8494,6 +8494,16 @@ ins_pageup() pos_T tpos; undisplay_dollar(); + +#ifdef FEAT_WINDOWS + if (mod_mask & MOD_MASK_CTRL) + { + /* <C-PageUp>: tab page back */ + goto_tabpage(-1); + return; + } +#endif + tpos = curwin->w_cursor; if (onepage(BACKWARD, 1L) == OK) { @@ -8543,6 +8553,16 @@ ins_pagedown() pos_T tpos; undisplay_dollar(); + +#ifdef FEAT_WINDOWS + if (mod_mask & MOD_MASK_CTRL) + { + /* <C-PageDown>: tab page forward */ + goto_tabpage(0); + return; + } +#endif + tpos = curwin->w_cursor; if (onepage(FORWARD, 1L) == OK) { diff --git a/src/ex_getln.c b/src/ex_getln.c index e4a1c99b4..11069f25e 100644 --- a/src/ex_getln.c +++ b/src/ex_getln.c @@ -4444,8 +4444,9 @@ ExpandGeneric(xp, regmatch, num_file, file, func) } } - /* Sort the results. */ - sort_strings(*file, *num_file); + /* Sort the results. Keep menu's in the specified order. */ + if (xp->xp_context != EXPAND_MENUNAMES && xp->xp_context != EXPAND_MENUS) + sort_strings(*file, *num_file); return OK; } diff --git a/src/misc1.c b/src/misc1.c index c8d0000ab..905df158c 100644 --- a/src/misc1.c +++ b/src/misc1.c @@ -3085,6 +3085,7 @@ get_keystroke() mch_memmove(buf, buf + 3, (size_t)len); continue; } + break; } #ifdef FEAT_MBYTE if (has_mbyte) @@ -4771,6 +4772,7 @@ static int cin_isdo __ARGS((char_u *)); static int cin_iswhileofdo __ARGS((char_u *, linenr_T, int)); static int cin_isbreak __ARGS((char_u *)); static int cin_is_cpp_baseclass __ARGS((char_u *line, colnr_T *col)); +static int get_baseclass_amount __ARGS((int col, int ind_maxparen, int ind_maxcomment, int ind_cpp_baseclass)); static int cin_ends_in __ARGS((char_u *, char_u *, char_u *)); static int cin_skip2pos __ARGS((pos_T *trypos)); static pos_T *find_start_brace __ARGS((int)); @@ -5447,7 +5449,8 @@ cin_isbreak(p) return (STRNCMP(p, "break", 5) == 0 && !vim_isIDc(p[5])); } -/* Find the position of a C++ base-class declaration or +/* + * Find the position of a C++ base-class declaration or * constructor-initialization. eg: * * class MyClass : @@ -5462,10 +5465,11 @@ cin_isbreak(p) static int cin_is_cpp_baseclass(line, col) char_u *line; - colnr_T *col; + colnr_T *col; /* return: column to align with */ { char_u *s; int class_or_struct, lookfor_ctor_init, cpp_base_class; + linenr_T lnum = curwin->w_cursor.lnum; *col = 0; @@ -5478,8 +5482,49 @@ cin_is_cpp_baseclass(line, col) cpp_base_class = lookfor_ctor_init = class_or_struct = FALSE; - while(*s != NUL) + /* Search for a line starting with '#', empty, ending in ';' or containing + * '{' or '}' and start below it. This handles the following situations: + * a = cond ? + * func() : + * asdf; + * func::foo() + * : something + * {} + * Foo::Foo (int one, int two) + * : something(4), + * somethingelse(3) + * {} + */ + while (lnum > 1) { + s = skipwhite(ml_get(lnum - 1)); + if (*s == '#' || *s == NUL) + break; + while (*s != NUL) + { + s = cin_skipcomment(s); + if (*s == '{' || *s == '}' + || (*s == ';' && cin_nocode(s + 1))) + break; + if (*s != NUL) + ++s; + } + if (*s != NUL) + break; + --lnum; + } + + s = cin_skipcomment(ml_get(lnum)); + for (;;) + { + if (*s == NUL) + { + if (lnum == curwin->w_cursor.lnum) + break; + /* Continue in the cursor line. */ + s = cin_skipcomment(ml_get(++lnum)); + } + if (s[0] == ':') { if (s[1] == ':') @@ -5542,41 +5587,51 @@ cin_is_cpp_baseclass(line, col) lookfor_ctor_init = FALSE; /* the first statement starts here: lineup with this one... */ - if (cpp_base_class && *col == 0) + if (cpp_base_class) *col = (colnr_T)(s - line); } + /* When the line ends in a comma don't align with it. */ + if (lnum == curwin->w_cursor.lnum && *s == ',' && cin_nocode(s + 1)) + *col = 0; + s = cin_skipcomment(s + 1); } } - if (cpp_base_class && curwin->w_cursor.lnum > 1) + return cpp_base_class; +} + + static int +get_baseclass_amount(col, ind_maxparen, ind_maxcomment, ind_cpp_baseclass) + int col; + int ind_maxparen; + int ind_maxcomment; + int ind_cpp_baseclass; +{ + int amount; + colnr_T vcol; + pos_T *trypos; + + if (col == 0) { - /* Check that there is no '?' in the previous line to catch: - * a = cond ? - * func() : - * asdf; - */ - s = ml_get(curwin->w_cursor.lnum - 1); - if (!cin_ispreproc(s)) - while (*s != NUL) - { - s = cin_skipcomment(s); - if (*s == '?') - /* Disable when finding a '?'... */ - cpp_base_class = FALSE; - else if (*s == ';' && cin_nocode(s + 1)) - { - /* ...but re-enable when the line ends in ';'. */ - cpp_base_class = TRUE; - break; - } - if (*s != NUL) - ++s; - } + amount = get_indent(); + if (find_last_paren(ml_get_curline(), '(', ')') + && (trypos = find_match_paren(ind_maxparen, + ind_maxcomment)) != NULL) + amount = get_indent_lnum(trypos->lnum); /* XXX */ + if (!cin_ends_in(ml_get_curline(), (char_u *)",", NULL)) + amount += ind_cpp_baseclass; } - - return cpp_base_class; + else + { + curwin->w_cursor.col = col; + getvcol(curwin, &curwin->w_cursor, &vcol, NULL, NULL); + amount = (int)vcol; + } + if (amount < ind_cpp_baseclass) + amount = ind_cpp_baseclass; + return amount; } /* @@ -6902,22 +6957,17 @@ get_c_indent() else amount += ind_continuation; } - else if (col == 0 || theline[0] == '{') + else if (theline[0] == '{') { - amount = get_indent(); - if (find_last_paren(l, '(', ')') - && (trypos = find_match_paren(ind_maxparen, - ind_maxcomment)) != NULL) - amount = get_indent_lnum(trypos->lnum); /* XXX */ - if (theline[0] != '{') - amount += ind_cpp_baseclass; + /* Need to find start of the declaration. */ + lookfor = LOOKFOR_UNTERM; + ind_continuation = 0; + continue; } else - { - curwin->w_cursor.col = col; - getvcol(curwin, &curwin->w_cursor, &col, NULL, NULL); - amount = (int)col; - } + /* XXX */ + amount = get_baseclass_amount(col, ind_maxparen, + ind_maxcomment, ind_cpp_baseclass); break; } else if (lookfor == LOOKFOR_CPP_BASECLASS) @@ -6967,7 +7017,8 @@ get_c_indent() * If we are looking for ',', we also look for matching * braces. */ - if (trypos == NULL && find_last_paren(l, '{', '}')) + if (trypos == NULL && terminated == ',' + && find_last_paren(l, '{', '}')) trypos = find_start_brace(ind_maxcomment); if (trypos != NULL) @@ -7490,21 +7541,9 @@ term_again: } if (n) { - if (col == 0) - { - amount = get_indent() + ind_cpp_baseclass; /* XXX */ - if (find_last_paren(l, '(', ')') - && (trypos = find_match_paren(ind_maxparen, - ind_maxcomment)) != NULL) - amount = get_indent_lnum(trypos->lnum) - + ind_cpp_baseclass; /* XXX */ - } - else - { - curwin->w_cursor.col = col; - getvcol(curwin, &curwin->w_cursor, &col, NULL, NULL); - amount = (int)col; - } + /* XXX */ + amount = get_baseclass_amount(col, ind_maxparen, + ind_maxcomment, ind_cpp_baseclass); break; } @@ -7604,7 +7643,7 @@ term_again: * bar; * indent_to_0 here; */ - if (cin_ends_in(l, (char_u*)";", NULL)) + if (cin_ends_in(l, (char_u *)";", NULL)) { l = ml_get(curwin->w_cursor.lnum - 1); if (cin_ends_in(l, (char_u *)",", NULL) diff --git a/src/option.c b/src/option.c index 36cfe035e..70f686a51 100644 --- a/src/option.c +++ b/src/option.c @@ -2066,7 +2066,7 @@ static struct vimoption {"sessionoptions", "ssop", P_STRING|P_VI_DEF|P_COMMA|P_NODUP, #ifdef FEAT_SESSION (char_u *)&p_ssop, PV_NONE, - {(char_u *)"blank,buffers,curdir,folds,help,options,tabpage,winsize", + {(char_u *)"blank,buffers,curdir,folds,help,options,tabpages,winsize", (char_u *)0L} #else (char_u *)NULL, PV_NONE, @@ -6458,6 +6458,12 @@ did_set_string_option(opt_idx, varp, new_value_alloced, oldval, errbuf, if (check_opt_strings(p_fcl, p_fcl_values, TRUE) != OK) errmsg = e_invarg; } + /* 'foldignore' */ + else if (gvarp == &curwin->w_allbuf_opt.wo_fdi) + { + if (foldmethodIsIndent(curwin)) + foldUpdateAll(curwin); + } #endif #ifdef FEAT_VIRTUALEDIT diff --git a/src/os_mswin.c b/src/os_mswin.c index 50a03a577..d196c869a 100644 --- a/src/os_mswin.c +++ b/src/os_mswin.c @@ -584,20 +584,6 @@ display_errors() for (p = (char *)error_ga.ga_data; *p; ++p) if (!isspace(*p)) { -#if 0 - /* Truncate a very long message, it will go off-screen. */ - if (STRLEN(p) > 2000) - { - char_u *s = p + 2000 - 14; - -#ifdef FEAT_MBYTE - if (has_mbyte) - s -= (*mb_head_off)(p, s); -#endif - STRCPY(s, _("...(truncated)")); - } -#endif - (void)gui_mch_dialog( #ifdef FEAT_GUI gui.starting ? VIM_INFO : @@ -608,13 +594,6 @@ display_errors() #endif (char_u *)_("Error"), p, (char_u *)_("&Ok"), 1, NULL); -#if 0 -#ifdef WIN3264 - MessageBox(NULL, p, "Vim", MB_TASKMODAL|MB_SETFOREGROUND); -#else - MessageBox(NULL, p, "Vim", MB_TASKMODAL); -#endif -#endif break; } ga_clear(&error_ga); diff --git a/src/testdir/test3.in b/src/testdir/test3.in index 51ad72095..898311834 100644 --- a/src/testdir/test3.in +++ b/src/testdir/test3.in @@ -742,6 +742,31 @@ int main(void) next_line_of_code(); } +barry() +{ + Foo::Foo (int one, + int two) + : something(4) + {} +} + +barry() +{ + Foo::Foo (int one, int two) + : something(4) + {} +} + +Constructor::Constructor(int a, + int b + ) : + BaseClass(a, + b, + c), + mMember(b) +{ +} + /* end of AUTO */ STARTTEST @@ -1189,6 +1214,20 @@ protected: }; STARTTEST +:set cino=+20 +2kdd]]=][ +ENDTEST + + void +foo() +{ + if (a) + { + } else + asdf; +} + +STARTTEST :set cino=(0,W2s 2kdd]]=][ ENDTEST diff --git a/src/testdir/test3.ok b/src/testdir/test3.ok index b197a28e0..2c7fd17f5 100644 --- a/src/testdir/test3.ok +++ b/src/testdir/test3.ok @@ -618,7 +618,7 @@ Constructor::Constructor(int a, Constructor::Constructor(int a, int b ) /*x*/ : /*x*/ BaseClass(a), - member(b) + member(b) { } @@ -651,7 +651,7 @@ class CAbc : }; class CAbc : public BaseClass1, - protected BaseClass2 + protected BaseClass2 { }; @@ -730,6 +730,31 @@ int main(void) next_line_of_code(); } +barry() +{ + Foo::Foo (int one, + int two) + : something(4) + {} +} + +barry() +{ + Foo::Foo (int one, int two) + : something(4) + {} +} + +Constructor::Constructor(int a, + int b + ) : + BaseClass(a, + b, + c), + mMember(b) +{ +} + /* end of AUTO */ @@ -1070,6 +1095,16 @@ protected: }; + void +foo() +{ + if (a) + { + } else + asdf; +} + + { averylongfunctionnamelongfunctionnameaverylongfunctionname()->asd( asdasdf, diff --git a/src/version.h b/src/version.h index 980a85c97..11f5d83d6 100644 --- a/src/version.h +++ b/src/version.h @@ -35,6 +35,6 @@ */ #define VIM_VERSION_NODOT "vim70d" #define VIM_VERSION_SHORT "7.0d" -#define VIM_VERSION_MEDIUM "7.0d02 BETA" -#define VIM_VERSION_LONG "VIM - Vi IMproved 7.0d02 BETA (2006 Apr 12)" -#define VIM_VERSION_LONG_DATE "VIM - Vi IMproved 7.0d02 BETA (2006 Apr 12, compiled " +#define VIM_VERSION_MEDIUM "7.0d03 BETA" +#define VIM_VERSION_LONG "VIM - Vi IMproved 7.0d03 BETA (2006 Apr 13)" +#define VIM_VERSION_LONG_DATE "VIM - Vi IMproved 7.0d03 BETA (2006 Apr 13, compiled " |