From 9506cad7a1a6e52a613f356de969cbd980815777 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Sun, 15 Jan 2017 13:53:49 +0100 Subject: [PATCH 01/20] patch 8.0.0188: redrawing for 'cursorbind' is inefficient Problem: Using NOT_VALID for redraw_later() to update the cursor line/column highlighting is not efficient. Solution: Call validate_cursor() when 'cul' or 'cuc' is set. --- src/move.c | 6 ++---- src/version.c | 2 ++ 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/move.c b/src/move.c index 5968a8b088..e2639fd203 100644 --- a/src/move.c +++ b/src/move.c @@ -2841,17 +2841,15 @@ do_check_cursorbind(void) restart_edit_save = restart_edit; restart_edit = TRUE; check_cursor(); -# ifdef FEAT_SYN_HL - if (curwin->w_p_cuc) + if (curwin->w_p_cul || curwin->w_p_cuc) validate_cursor(); -# endif restart_edit = restart_edit_save; # ifdef FEAT_MBYTE /* Correct cursor for multi-byte character. */ if (has_mbyte) mb_adjust_cursor(); # endif - redraw_later(curwin->w_p_cul ? NOT_VALID : VALID); + redraw_later(VALID); /* Only scroll when 'scrollbind' hasn't done this. */ if (!curwin->w_p_scb) diff --git a/src/version.c b/src/version.c index 814934ded8..8cb6cb8a2b 100644 --- a/src/version.c +++ b/src/version.c @@ -764,6 +764,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 188, /**/ 187, /**/ From 296b1f28ca9cedeb55872f306808b2214b519ce7 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Sun, 15 Jan 2017 15:22:33 +0100 Subject: [PATCH 02/20] patch 8.0.0189: profile commands are not tested Problem: There are no tests for the :profile command. Solution: Add tests. (Dominique Pelle, closes #1383) --- src/Makefile | 1 + src/testdir/Make_all.mak | 1 + src/testdir/test_profile.vim | 135 +++++++++++++++++++++++++++++++++++ src/version.c | 2 + 4 files changed, 139 insertions(+) create mode 100644 src/testdir/test_profile.vim diff --git a/src/Makefile b/src/Makefile index db70672864..38ca4cd16e 100644 --- a/src/Makefile +++ b/src/Makefile @@ -2147,6 +2147,7 @@ test_arglist \ test_partial \ test_perl \ test_popup \ + test_profile \ test_quickfix \ test_regexp_latin \ test_regexp_utf8 \ diff --git a/src/testdir/Make_all.mak b/src/testdir/Make_all.mak index 956d321eab..5b9c5724c3 100644 --- a/src/testdir/Make_all.mak +++ b/src/testdir/Make_all.mak @@ -175,6 +175,7 @@ NEW_TESTS = test_arglist.res \ test_normal.res \ test_packadd.res \ test_perl.res \ + test_profile.res \ test_quickfix.res \ test_ruby.res \ test_search.res \ diff --git a/src/testdir/test_profile.vim b/src/testdir/test_profile.vim new file mode 100644 index 0000000000..36c05683d5 --- /dev/null +++ b/src/testdir/test_profile.vim @@ -0,0 +1,135 @@ +" Test Vim profiler +if !has('profile') + finish +endif + +func Test_profile_func() + if !has('unix') + return + endif + let lines = [ + \ "func! Foo1()", + \ "endfunc", + \ "func! Foo2()", + \ " let count = 100", + \ " while count > 0", + \ " let count = count - 1", + \ " endwhile", + \ "endfunc", + \ "func! Foo3()", + \ "endfunc", + \ "func! Bar()", + \ "endfunc", + \ "call Foo1()", + \ "call Foo1()", + \ "profile pause", + \ "call Foo1()", + \ "profile continue", + \ "call Foo2()", + \ "call Foo3()", + \ "call Bar()", + \ "if !v:profiling", + \ " delfunc Foo2", + \ "endif", + \ "delfunc Foo3", + \ ] + + call writefile(lines, 'Xprofile_func.vim') + let a = system(v:progpath + \ . " -u NONE -i NONE --noplugin" + \ . " -c 'profile start Xprofile_func.log'" + \ . " -c 'profile func Foo*'" + \ . " -c 'so Xprofile_func.vim'" + \ . " -c 'qall!'") + let lines = readfile('Xprofile_func.log') + + call assert_equal(28, len(lines)) + + call assert_equal('FUNCTION Foo1()', lines[0]) + call assert_equal('Called 2 times', lines[1]) + call assert_equal('FUNCTION Foo2()', lines[7]) + call assert_equal('Called 1 time', lines[8]) + + " - Foo1() is called 3 times but should be reported as called twice + " since one call is in between "profile pause" .. "profile continue". + " - Foo2() should come before Foo1() since Foo1() does much more work.\ + " - Foo3() is not reported because function is deleted. + " - Unlike Foo3(), Foo2() should not be deleted since there is a check + " for v:profiling. + " - Bar() is not reported since it does not match "profile func Foo*". + call assert_equal('FUNCTIONS SORTED ON TOTAL TIME', lines[18]) + call assert_equal('count total (s) self (s) function', lines[19]) + call assert_match('^\s*1\s\+\d\+\.\d\+\s\+Foo2()$', lines[20]) + call assert_match('^\s*2\s\+\d\+\.\d\+\s\+Foo1()$', lines[21]) + call assert_equal('', lines[22]) + call assert_equal('FUNCTIONS SORTED ON SELF TIME', lines[23]) + call assert_equal('count total (s) self (s) function', lines[24]) + call assert_match('^\s*1\s\+\d\+\.\d\+\s\+Foo2()$', lines[25]) + call assert_match('^\s*2\s\+\d\+\.\d\+\s\+Foo1()$', lines[26]) + call assert_equal('', lines[27]) + + call delete('Xprofile_func.vim') + call delete('Xprofile_func.log') +endfunc + +func Test_profile_file() + if !has('unix') + return + endif + let lines = [ + \ 'func! Foo()', + \ 'endfunc', + \ 'for i in range(10)', + \ ' " a comment', + \ ' call Foo()', + \ 'endfor', + \ 'call Foo()', + \ ] + + call writefile(lines, 'Xprofile_file.vim') + let a = system(v:progpath + \ . " -u NONE -i NONE --noplugin" + \ . " -c 'profile start Xprofile_file.log'" + \ . " -c 'profile file Xprofile_file.vim'" + \ . " -c 'so Xprofile_file.vim'" + \ . " -c 'so Xprofile_file.vim'" + \ . " -c 'qall!'") + + let lines = readfile('Xprofile_file.log') + + call assert_equal(14, len(lines)) + + call assert_match('^SCRIPT .*Xprofile_file.vim$', lines[0]) + call assert_equal('Sourced 2 times', lines[1]) + call assert_match('^Total time:\s\+\d\+\.\d\+$', lines[2]) + call assert_match('^ Self time:\s\+\d\+\.\d\+$', lines[3]) + call assert_equal('', lines[4]) + call assert_equal('count total (s) self (s)', lines[5]) + call assert_equal(' func! Foo()', lines[6]) + call assert_equal(' endfunc', lines[7]) + " Loop iterates 10 times. Since script runs twice, body executes 20 times. + " First line of loop executes one more time than body to detect end of loop. + call assert_match('^\s*22\s\+\d\+\.\d\+\s\+for i in range(10)$', lines[8]) + call assert_equal(' " a comment', lines[9]) + call assert_match('^\s*20\s\+\d\+\.\d\+\s\+\d\+\.\d\+\s\+call Foo()$', lines[10]) + call assert_match('^\s*20\s\+\d\+\.\d\+\s\+endfor$', lines[11]) + call assert_match('^\s*2\s\+\d\+\.\d\+\s\+\d\+\.\d\+\s\+call Foo()$', lines[12]) + call assert_equal('', lines[13]) + + call delete('Xprofile_file.vim') + call delete('Xprofile_file.log') +endfunc + +func Test_profile_completion() + call feedkeys(":profile \\\"\", 'tx') + call assert_equal('"profile continue file func pause start', @:) + + call feedkeys(":profile start test_prof\\\"\", 'tx') + call assert_match('^"profile start.* test_profile\.vim', @:) +endfunc + +func Test_profile_errors() + call assert_fails("profile func Foo", 'E750:') + call assert_fails("profile pause", 'E750:') + call assert_fails("profile continue", 'E750:') +endfunc diff --git a/src/version.c b/src/version.c index 8cb6cb8a2b..368a984e3b 100644 --- a/src/version.c +++ b/src/version.c @@ -764,6 +764,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 189, /**/ 188, /**/ From 810f9c361c83afb36b9f1cdadca2b93f1201d039 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Sun, 15 Jan 2017 16:52:51 +0100 Subject: [PATCH 03/20] patch 8.0.0190: finding duplicate tags uses a slow linear search Problem: Detecting duplicate tags uses a slow linear search. Solution: Use a much faster hash table solution. (James McCoy, closes #1046) But don't add hi_keylen, it makes hash tables 50% bigger. --- src/tag.c | 354 +++++++++++++++++++++++++------------------------- src/version.c | 2 + 2 files changed, 177 insertions(+), 179 deletions(-) diff --git a/src/tag.c b/src/tag.c index 646cbcd62b..94b5e2b68a 100644 --- a/src/tag.c +++ b/src/tag.c @@ -35,9 +35,9 @@ typedef struct tag_pointers } tagptrs_T; /* - * The matching tags are first stored in ga_match[]. In which one depends on - * the priority of the match. - * At the end, the matches from ga_match[] are concatenated, to make a list + * The matching tags are first stored in one of the ht_match[] hash tables. In + * which one depends on the priority of the match. + * At the end, all the matches from ht_match[] are concatenated, to make a list * sorted on priority. */ #define MT_ST_CUR 0 /* static match in current file */ @@ -1341,12 +1341,9 @@ find_tags( int is_etag; /* current file is emaces style */ #endif - struct match_found - { - int len; /* nr of chars of match[] to be compared */ - char_u match[1]; /* actually longer */ - } *mfp, *mfp2; - garray_T ga_match[MT_COUNT]; + char_u *mfp; + hashtab_T ht_match[MT_COUNT]; + hash_T hash = 0; int match_count = 0; /* number of matches found */ char_u **matches; int mtt; @@ -1402,16 +1399,16 @@ find_tags( vimconv.vc_type = CONV_NONE; #endif -/* - * Allocate memory for the buffers that are used - */ + /* + * Allocate memory for the buffers that are used + */ lbuf = alloc(lbuf_size); tag_fname = alloc(MAXPATHL + 1); #ifdef FEAT_EMACS_TAGS ebuf = alloc(LSIZE); #endif for (mtt = 0; mtt < MT_COUNT; ++mtt) - ga_init2(&ga_match[mtt], (int)sizeof(struct match_found *), 100); + hash_init(&ht_match[mtt]); /* check for out of memory situation */ if (lbuf == NULL || tag_fname == NULL @@ -2206,10 +2203,12 @@ parse_line: } /* - * If a match is found, add it to ga_match[]. + * If a match is found, add it to ht_match[]. */ if (match) { + int len = 0; + #ifdef FEAT_CSCOPE if (use_cscope) { @@ -2262,179 +2261,169 @@ parse_line: } /* - * Add the found match in ga_match[mtt], avoiding duplicates. + * Add the found match in ht_match[mtt]. * Store the info we need later, which depends on the kind of * tags we are dealing with. */ - if (ga_grow(&ga_match[mtt], 1) == OK) + if (help_only) { - int len; - int heuristic; - - if (help_only) - { #ifdef FEAT_MULTI_LANG # define ML_EXTRA 3 #else # define ML_EXTRA 0 #endif - /* - * Append the help-heuristic number after the - * tagname, for sorting it later. - */ - *tagp.tagname_end = NUL; - len = (int)(tagp.tagname_end - tagp.tagname); - mfp = (struct match_found *) - alloc((int)sizeof(struct match_found) + len - + 10 + ML_EXTRA); - if (mfp != NULL) - { - /* "len" includes the language and the NUL, but - * not the priority. */ - mfp->len = len + ML_EXTRA + 1; -#define ML_HELP_LEN 6 - p = mfp->match; - STRCPY(p, tagp.tagname); -#ifdef FEAT_MULTI_LANG - p[len] = '@'; - STRCPY(p + len + 1, help_lang); -#endif - - heuristic = help_heuristic(tagp.tagname, - match_re ? matchoff : 0, !match_no_ic); -#ifdef FEAT_MULTI_LANG - heuristic += help_pri; -#endif - sprintf((char *)p + len + 1 + ML_EXTRA, "%06d", - heuristic); - } - *tagp.tagname_end = TAB; - } - else if (name_only) + /* + * Append the help-heuristic number after the tagname, for + * sorting it later. The heuristic is ignored for + * detecting duplicates. + * The format is {tagname}@{lang}NUL{heuristic}NUL + */ + *tagp.tagname_end = NUL; + len = (int)(tagp.tagname_end - tagp.tagname); + mfp = (char_u *)alloc((int)sizeof(char_u) + len + 10 + ML_EXTRA + 1); + if (mfp != NULL) { - if (get_it_again) + int heuristic; + + p = mfp; + STRCPY(p, tagp.tagname); +#ifdef FEAT_MULTI_LANG + p[len] = '@'; + STRCPY(p + len + 1, help_lang); +#endif + + heuristic = help_heuristic(tagp.tagname, + match_re ? matchoff : 0, !match_no_ic); +#ifdef FEAT_MULTI_LANG + heuristic += help_pri; +#endif + sprintf((char *)p + len + 1 + ML_EXTRA, "%06d", + heuristic); + } + *tagp.tagname_end = TAB; + } + else if (name_only) + { + if (get_it_again) + { + char_u *temp_end = tagp.command; + + if (*temp_end == '/') + while (*temp_end && *temp_end != '\r' + && *temp_end != '\n' + && *temp_end != '$') + temp_end++; + + if (tagp.command + 2 < temp_end) { - char_u *temp_end = tagp.command; - - if (*temp_end == '/') - while (*temp_end && *temp_end != '\r' - && *temp_end != '\n' - && *temp_end != '$') - temp_end++; - - if (tagp.command + 2 < temp_end) - { - len = (int)(temp_end - tagp.command - 2); - mfp = (struct match_found *)alloc( - (int)sizeof(struct match_found) + len); - if (mfp != NULL) - { - mfp->len = len + 1; /* include the NUL */ - p = mfp->match; - vim_strncpy(p, tagp.command + 2, len); - } - } - else - mfp = NULL; - get_it_again = FALSE; + len = (int)(temp_end - tagp.command - 2); + mfp = (char_u *)alloc((int)sizeof(char_u) + len + 1); + if (mfp != NULL) + vim_strncpy(mfp, tagp.command + 2, len); } else - { - len = (int)(tagp.tagname_end - tagp.tagname); - mfp = (struct match_found *)alloc( - (int)sizeof(struct match_found) + len); - if (mfp != NULL) - { - mfp->len = len + 1; /* include the NUL */ - p = mfp->match; - vim_strncpy(p, tagp.tagname, len); - } - - /* if wanted, re-read line to get long form too */ - if (State & INSERT) - get_it_again = p_sft; - } + mfp = NULL; + get_it_again = FALSE; } else { - /* Save the tag in a buffer. - * Emacs tag: - * other tag: - * without Emacs tags: - */ - len = (int)STRLEN(tag_fname) - + (int)STRLEN(lbuf) + 3; -#ifdef FEAT_EMACS_TAGS - if (is_etag) - len += (int)STRLEN(ebuf) + 1; - else - ++len; -#endif - mfp = (struct match_found *)alloc( - (int)sizeof(struct match_found) + len); + len = (int)(tagp.tagname_end - tagp.tagname); + mfp = (char_u *)alloc((int)sizeof(char_u) + len + 1); if (mfp != NULL) - { - mfp->len = len; - p = mfp->match; - p[0] = mtt; - STRCPY(p + 1, tag_fname); -#ifdef BACKSLASH_IN_FILENAME - /* Ignore differences in slashes, avoid adding - * both path/file and path\file. */ - slash_adjust(p + 1); -#endif - s = p + 1 + STRLEN(tag_fname) + 1; -#ifdef FEAT_EMACS_TAGS - if (is_etag) - { - STRCPY(s, ebuf); - s += STRLEN(ebuf) + 1; - } - else - *s++ = NUL; -#endif - STRCPY(s, lbuf); - } - } + vim_strncpy(mfp, tagp.tagname, len); - if (mfp != NULL) - { - /* - * Don't add identical matches. - * This can take a lot of time when finding many - * matches, check for CTRL-C now and then. - * Add all cscope tags, because they are all listed. - */ -#ifdef FEAT_CSCOPE - if (use_cscope) - i = -1; - else -#endif - for (i = ga_match[mtt].ga_len; --i >= 0 && !got_int; ) - { - mfp2 = ((struct match_found **) - (ga_match[mtt].ga_data))[i]; - if (mfp2->len == mfp->len - && memcmp(mfp2->match, mfp->match, - (size_t)mfp->len) == 0) - break; - fast_breakcheck(); - } - if (i < 0) - { - ((struct match_found **)(ga_match[mtt].ga_data)) - [ga_match[mtt].ga_len++] = mfp; - ++match_count; - } - else - vim_free(mfp); + /* if wanted, re-read line to get long form too */ + if (State & INSERT) + get_it_again = p_sft; } } - else /* Out of memory! Just forget about the rest. */ + else { - retval = OK; - stop_searching = TRUE; - break; +#define TAG_SEP 0x01 + size_t tag_fname_len = STRLEN(tag_fname); +#ifdef FEAT_EMACS_TAGS + size_t ebuf_len = 0; +#endif + + /* Save the tag in a buffer. + * Use 0x01 to separate fields (Can't use NUL, because the + * hash key is terminated by NUL). + * Emacs tag: <0x01><0x01> + * other tag: <0x01><0x01> + * without Emacs tags: <0x01> + */ + len = (int)tag_fname_len + (int)STRLEN(lbuf) + 3; +#ifdef FEAT_EMACS_TAGS + if (is_etag) + { + ebuf_len = STRLEN(ebuf); + len += (int)ebuf_len + 1; + } + else + ++len; +#endif + mfp = (char_u *)alloc((int)sizeof(char_u) + len + 1); + if (mfp != NULL) + { + p = mfp; + p[0] = mtt; + STRCPY(p + 1, tag_fname); +#ifdef BACKSLASH_IN_FILENAME + /* Ignore differences in slashes, avoid adding + * both path/file and path\file. */ + slash_adjust(p + 1); +#endif + p[tag_fname_len + 1] = TAG_SEP; + s = p + 1 + tag_fname_len + 1; +#ifdef FEAT_EMACS_TAGS + if (is_etag) + { + STRCPY(s, ebuf); + s[ebuf_len] = TAG_SEP; + s += ebuf_len + 1; + } + else + *s++ = TAG_SEP; +#endif + STRCPY(s, lbuf); + } + } + + if (mfp != NULL) + { + hashitem_T *hi; + + /* + * Don't add identical matches. + * Add all cscope tags, because they are all listed. + * "mfp" is used as a hash key, there is a NUL byte to end + * the part matters for comparing, more bytes may follow + * after it. E.g. help tags store the priority after the + * NUL. + */ +#ifdef FEAT_CSCOPE + if (use_cscope) + hash++; + else +#endif + hash = hash_hash(mfp); + hi = hash_lookup(&ht_match[mtt], mfp, hash); + if (HASHITEM_EMPTY(hi)) + { + if (hash_add_item(&ht_match[mtt], hi, mfp, hash) + == FAIL) + { + /* Out of memory! Just forget about the rest. */ + retval = OK; + stop_searching = TRUE; + break; + } + else + ++match_count; + } + else + /* duplicate tag, drop it */ + vim_free(mfp); } } #ifdef FEAT_CSCOPE @@ -2532,7 +2521,7 @@ findtag_end: #endif /* - * Move the matches from the ga_match[] arrays into one list of + * Move the matches from the ht_match[] arrays into one list of * matches. When retval == FAIL, free the matches. */ if (retval == FAIL) @@ -2546,22 +2535,29 @@ findtag_end: match_count = 0; for (mtt = 0; mtt < MT_COUNT; ++mtt) { - for (i = 0; i < ga_match[mtt].ga_len; ++i) + hashitem_T *hi; + long_u todo; + + todo = (long)ht_match[mtt].ht_used; + for (hi = ht_match[mtt].ht_array; todo > 0; ++hi) { - mfp = ((struct match_found **)(ga_match[mtt].ga_data))[i]; - if (matches == NULL) - vim_free(mfp); - else + if (!HASHITEM_EMPTY(hi)) { - /* To avoid allocating memory again we turn the struct - * match_found into a string. For help the priority was not - * included in the length. */ - mch_memmove(mfp, mfp->match, - (size_t)(mfp->len + (help_only ? ML_HELP_LEN : 0))); - matches[match_count++] = (char_u *)mfp; + mfp = hi->hi_key; + if (matches == NULL) + vim_free(mfp); + else + { + /* now change the TAG_SEP back to NUL */ + for (p = mfp; *p != NUL; ++p) + if (*p == TAG_SEP) + *p = NUL; + matches[match_count++] = (char_u *)mfp; + } + todo--; } } - ga_clear(&ga_match[mtt]); + hash_clear(&ht_match[mtt]); } *matchesp = matches; diff --git a/src/version.c b/src/version.c index 368a984e3b..2094db704b 100644 --- a/src/version.c +++ b/src/version.c @@ -764,6 +764,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 190, /**/ 189, /**/ From 4f391796b7de78a434a2cc7107034603df414905 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Sun, 15 Jan 2017 16:59:07 +0100 Subject: [PATCH 04/20] patch 8.0.0191: can't build with Ruby on some systems Problem: Some systems do not have ruby_sysinit(), causing the build to fail. Solution: Clean up how ruby_sysinit() and NtInitialize() are used. (Taro Muraoka) --- src/if_ruby.c | 8 ++++---- src/version.c | 2 ++ 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/if_ruby.c b/src/if_ruby.c index 509d2f6cf1..afa27abe2c 100644 --- a/src/if_ruby.c +++ b/src/if_ruby.c @@ -303,6 +303,7 @@ static void ruby_vim_init(void); # define ruby_init_loadpath dll_ruby_init_loadpath # ifdef WIN3264 # define NtInitialize dll_NtInitialize +# define ruby_sysinit dll_ruby_sysinit # if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 18 # define rb_w32_snprintf dll_rb_w32_snprintf # endif @@ -405,6 +406,7 @@ static void (*dll_ruby_init) (void); static void (*dll_ruby_init_loadpath) (void); # ifdef WIN3264 static void (*dll_NtInitialize) (int*, char***); +static void (*dll_ruby_sysinit) (int*, char***); # if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 18 static int (*dll_rb_w32_snprintf)(char*, size_t, const char*, ...); # endif @@ -594,13 +596,11 @@ static struct {"ruby_init", (RUBY_PROC*)&dll_ruby_init}, {"ruby_init_loadpath", (RUBY_PROC*)&dll_ruby_init_loadpath}, # ifdef WIN3264 - { # if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER < 19 - "NtInitialize", + {"NtInitialize", (RUBY_PROC*)&dll_NtInitialize}, # else - "ruby_sysinit", + {"ruby_sysinit", (RUBY_PROC*)&dll_ruby_sysinit}, # endif - (RUBY_PROC*)&dll_NtInitialize}, # if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 18 {"rb_w32_snprintf", (RUBY_PROC*)&dll_rb_w32_snprintf}, # endif diff --git a/src/version.c b/src/version.c index 2094db704b..bf4b82d10c 100644 --- a/src/version.c +++ b/src/version.c @@ -764,6 +764,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 191, /**/ 190, /**/ From 42b8d916c719002dbafade6b977d4e266f8712dc Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Sun, 15 Jan 2017 17:18:57 +0100 Subject: [PATCH 05/20] patch 8.0.0192: cannot build with tiny features Problem: Build fails with tiny features. Solution: Change #ifdef for hash_clear(). Avoid warning for unused argument. --- src/hashtab.c | 2 -- src/if_cscope.c | 2 +- src/version.c | 2 ++ 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/hashtab.c b/src/hashtab.c index 658bfb9694..4bf41e0dab 100644 --- a/src/hashtab.c +++ b/src/hashtab.c @@ -70,7 +70,6 @@ hash_init(hashtab_T *ht) ht->ht_mask = HT_INIT_SIZE - 1; } -#if defined(FEAT_EVAL) || defined(FEAT_SYN_HL) || defined(PROTO) /* * Free the array of a hash table. Does not free the items it contains! * If "ht" is not freed then you should call hash_init() next! @@ -104,7 +103,6 @@ hash_clear_all(hashtab_T *ht, int off) } hash_clear(ht); } -#endif /* * Find "key" in hashtable "ht". "key" must not be NULL. diff --git a/src/if_cscope.c b/src/if_cscope.c index 31c0371879..60480a5b7e 100644 --- a/src/if_cscope.c +++ b/src/if_cscope.c @@ -207,7 +207,7 @@ set_context_in_cscope_cmd( static void do_cscope_general( exarg_T *eap, - int make_split) /* whether to split window */ + int make_split UNUSED) /* whether to split window */ { cscmd_T *cmdp; diff --git a/src/version.c b/src/version.c index bf4b82d10c..a825013301 100644 --- a/src/version.c +++ b/src/version.c @@ -764,6 +764,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 192, /**/ 191, /**/ From 1b9750d8054ce4a5a6f84af9f10654330bbf869b Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Sun, 15 Jan 2017 20:51:37 +0100 Subject: [PATCH 06/20] patch 8.0.0193: accidentally removed #ifdef Problem: Accidentally removed #ifdef. Solution: Put it back. (Masanori Misono) --- src/move.c | 2 ++ src/version.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/move.c b/src/move.c index e2639fd203..c4f21a7864 100644 --- a/src/move.c +++ b/src/move.c @@ -2841,8 +2841,10 @@ do_check_cursorbind(void) restart_edit_save = restart_edit; restart_edit = TRUE; check_cursor(); +# ifdef FEAT_SYN_HL if (curwin->w_p_cul || curwin->w_p_cuc) validate_cursor(); +# endif restart_edit = restart_edit_save; # ifdef FEAT_MBYTE /* Correct cursor for multi-byte character. */ diff --git a/src/version.c b/src/version.c index a825013301..401f79fe38 100644 --- a/src/version.c +++ b/src/version.c @@ -764,6 +764,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 193, /**/ 192, /**/ From e32bbded641a5da0263ecf82f9ccc95a8e0a089e Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Sun, 15 Jan 2017 21:12:48 +0100 Subject: [PATCH 07/20] patch 8.0.0194: profile tests fails if total and self time are equal Problem: Profile tests fails if total and self time are equal. Solution: Make one time optional. --- src/testdir/test_profile.vim | 3 ++- src/version.c | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/testdir/test_profile.vim b/src/testdir/test_profile.vim index 36c05683d5..23d148e47d 100644 --- a/src/testdir/test_profile.vim +++ b/src/testdir/test_profile.vim @@ -113,7 +113,8 @@ func Test_profile_file() call assert_equal(' " a comment', lines[9]) call assert_match('^\s*20\s\+\d\+\.\d\+\s\+\d\+\.\d\+\s\+call Foo()$', lines[10]) call assert_match('^\s*20\s\+\d\+\.\d\+\s\+endfor$', lines[11]) - call assert_match('^\s*2\s\+\d\+\.\d\+\s\+\d\+\.\d\+\s\+call Foo()$', lines[12]) + " if self and total are equal we only get one number + call assert_match('^\s*2\s\+\(\d\+\.\d\+\s\+\)\=\d\+\.\d\+\s\+call Foo()$', lines[12]) call assert_equal('', lines[13]) call delete('Xprofile_file.vim') diff --git a/src/version.c b/src/version.c index 401f79fe38..cfb4e5969f 100644 --- a/src/version.c +++ b/src/version.c @@ -764,6 +764,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 194, /**/ 193, /**/ From a9d23c20879d0dcb289a4db54b3c7df060f87c3c Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Mon, 16 Jan 2017 20:53:34 +0100 Subject: [PATCH 08/20] patch 8.0.0195: fail to jump to static tag in current file Problem: Jumping to a tag that is a static item in the current file fails. (Kazunobu Kuriyama) Solution: Make sure the first byte of the tag key is not NUL. (Suggested by James McCoy, closes #1387) --- src/tag.c | 23 +++++++++++++---------- src/testdir/test_tagjump.vim | 18 ++++++++++++++++++ src/version.c | 2 ++ 3 files changed, 33 insertions(+), 10 deletions(-) diff --git a/src/tag.c b/src/tag.c index 94b5e2b68a..a80a362df3 100644 --- a/src/tag.c +++ b/src/tag.c @@ -44,10 +44,6 @@ typedef struct tag_pointers #define MT_GL_CUR 1 /* global match in current file */ #define MT_GL_OTH 2 /* global match in other file */ #define MT_ST_OTH 3 /* static match in other file */ -#define MT_IC_ST_CUR 4 /* icase static match in current file */ -#define MT_IC_GL_CUR 5 /* icase global match in current file */ -#define MT_IC_GL_OTH 6 /* icase global match in other file */ -#define MT_IC_ST_OTH 7 /* icase static match in other file */ #define MT_IC_OFF 4 /* add for icase match */ #define MT_RE_OFF 8 /* add for regexp match */ #define MT_MASK 7 /* mask for printing priority */ @@ -2317,7 +2313,7 @@ parse_line: if (tagp.command + 2 < temp_end) { len = (int)(temp_end - tagp.command - 2); - mfp = (char_u *)alloc((int)sizeof(char_u) + len + 1); + mfp = (char_u *)alloc(len + 2); if (mfp != NULL) vim_strncpy(mfp, tagp.command + 2, len); } @@ -2351,6 +2347,7 @@ parse_line: * Emacs tag: <0x01><0x01> * other tag: <0x01><0x01> * without Emacs tags: <0x01> + * Here is the "mtt" value plus 1 to avoid NUL. */ len = (int)tag_fname_len + (int)STRLEN(lbuf) + 3; #ifdef FEAT_EMACS_TAGS @@ -2366,7 +2363,7 @@ parse_line: if (mfp != NULL) { p = mfp; - p[0] = mtt; + p[0] = mtt + 1; STRCPY(p + 1, tag_fname); #ifdef BACKSLASH_IN_FILENAME /* Ignore differences in slashes, avoid adding @@ -2548,10 +2545,16 @@ findtag_end: vim_free(mfp); else { - /* now change the TAG_SEP back to NUL */ - for (p = mfp; *p != NUL; ++p) - if (*p == TAG_SEP) - *p = NUL; + if (!name_only) + { + /* Change mtt back to zero-based. */ + *mfp = *mfp - 1; + + /* change the TAG_SEP back to NUL */ + for (p = mfp + 1; *p != NUL; ++p) + if (*p == TAG_SEP) + *p = NUL; + } matches[match_count++] = (char_u *)mfp; } todo--; diff --git a/src/testdir/test_tagjump.vim b/src/testdir/test_tagjump.vim index 11ec144f63..221514db2c 100644 --- a/src/testdir/test_tagjump.vim +++ b/src/testdir/test_tagjump.vim @@ -23,6 +23,24 @@ func Test_cancel_ptjump() quit endfunc +func Test_static_tagjump() + set tags=Xtags + call writefile(["!_TAG_FILE_ENCODING\tutf-8\t//", + \ "one\tXfile1\t/^one/;\"\tf\tfile:\tsignature:(void)", + \ "word\tXfile2\tcmd2"], + \ 'Xtags') + new Xfile1 + call setline(1, ['empty', 'one()', 'empty']) + write + tag one + call assert_equal(2, line('.')) + + set tags& + call delete('Xtags') + call delete('Xfile1') + bwipe! +endfunc + " Tests for [ CTRL-I and CTRL-W CTRL-I commands function Test_keyword_jump() call writefile(["#include Xinclude", "", diff --git a/src/version.c b/src/version.c index cfb4e5969f..28c677696a 100644 --- a/src/version.c +++ b/src/version.c @@ -764,6 +764,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 195, /**/ 194, /**/ From c011a3d083001bcd9853b4447422f1819f3cee2f Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Mon, 16 Jan 2017 22:37:42 +0100 Subject: [PATCH 09/20] patch 8.0.0196: profile test is slo and does not work on MS-Windows Problem: The test for :profile is slow and does not work on MS-Windows. Solution: Use the "-es" argument. (Dominique Pelle) Swap single and double quotes for system() --- src/testdir/test_profile.vim | 90 ++++++++++++++++++++---------------- src/version.c | 2 + 2 files changed, 52 insertions(+), 40 deletions(-) diff --git a/src/testdir/test_profile.vim b/src/testdir/test_profile.vim index 23d148e47d..5f15d51b47 100644 --- a/src/testdir/test_profile.vim +++ b/src/testdir/test_profile.vim @@ -4,16 +4,13 @@ if !has('profile') endif func Test_profile_func() - if !has('unix') - return - endif let lines = [ \ "func! Foo1()", \ "endfunc", \ "func! Foo2()", - \ " let count = 100", - \ " while count > 0", - \ " let count = count - 1", + \ " let l:count = 100", + \ " while l:count > 0", + \ " let l:count = l:count - 1", \ " endwhile", \ "endfunc", \ "func! Foo3()", @@ -35,47 +32,59 @@ func Test_profile_func() \ ] call writefile(lines, 'Xprofile_func.vim') - let a = system(v:progpath - \ . " -u NONE -i NONE --noplugin" - \ . " -c 'profile start Xprofile_func.log'" - \ . " -c 'profile func Foo*'" - \ . " -c 'so Xprofile_func.vim'" - \ . " -c 'qall!'") + call system(v:progpath + \ . ' -es -u NONE -U NONE -i NONE --noplugin' + \ . ' -c "profile start Xprofile_func.log"' + \ . ' -c "profile func Foo*"' + \ . ' -c "so Xprofile_func.vim"' + \ . ' -c "qall!"') + call assert_equal(0, v:shell_error) + let lines = readfile('Xprofile_func.log') - call assert_equal(28, len(lines)) - - call assert_equal('FUNCTION Foo1()', lines[0]) - call assert_equal('Called 2 times', lines[1]) - call assert_equal('FUNCTION Foo2()', lines[7]) - call assert_equal('Called 1 time', lines[8]) - " - Foo1() is called 3 times but should be reported as called twice " since one call is in between "profile pause" .. "profile continue". - " - Foo2() should come before Foo1() since Foo1() does much more work.\ + " - Foo2() should come before Foo1() since Foo1() does much more work. " - Foo3() is not reported because function is deleted. " - Unlike Foo3(), Foo2() should not be deleted since there is a check " for v:profiling. " - Bar() is not reported since it does not match "profile func Foo*". - call assert_equal('FUNCTIONS SORTED ON TOTAL TIME', lines[18]) - call assert_equal('count total (s) self (s) function', lines[19]) - call assert_match('^\s*1\s\+\d\+\.\d\+\s\+Foo2()$', lines[20]) - call assert_match('^\s*2\s\+\d\+\.\d\+\s\+Foo1()$', lines[21]) - call assert_equal('', lines[22]) - call assert_equal('FUNCTIONS SORTED ON SELF TIME', lines[23]) - call assert_equal('count total (s) self (s) function', lines[24]) - call assert_match('^\s*1\s\+\d\+\.\d\+\s\+Foo2()$', lines[25]) - call assert_match('^\s*2\s\+\d\+\.\d\+\s\+Foo1()$', lines[26]) - call assert_equal('', lines[27]) + call assert_equal(28, len(lines)) + + call assert_equal('FUNCTION Foo1()', lines[0]) + call assert_equal('Called 2 times', lines[1]) + call assert_match('^Total time:\s\+\d\+\.\d\+$', lines[2]) + call assert_match('^ Self time:\s\+\d\+\.\d\+$', lines[3]) + call assert_equal('', lines[4]) + call assert_equal('count total (s) self (s)', lines[5]) + call assert_equal('', lines[6]) + call assert_equal('FUNCTION Foo2()', lines[7]) + call assert_equal('Called 1 time', lines[8]) + call assert_match('^Total time:\s\+\d\+\.\d\+$', lines[9]) + call assert_match('^ Self time:\s\+\d\+\.\d\+$', lines[10]) + call assert_equal('', lines[11]) + call assert_equal('count total (s) self (s)', lines[12]) + call assert_match('^\s*1\s\+.*\slet l:count = 100$', lines[13]) + call assert_match('^\s*101\s\+.*\swhile l:count > 0$', lines[14]) + call assert_match('^\s*100\s\+.*\s let l:count = l:count - 1$', lines[15]) + call assert_match('^\s*100\s\+.*\sendwhile$', lines[16]) + call assert_equal('', lines[17]) + call assert_equal('FUNCTIONS SORTED ON TOTAL TIME', lines[18]) + call assert_equal('count total (s) self (s) function', lines[19]) + call assert_match('^\s*1\s\+\d\+\.\d\+\s\+Foo2()$', lines[20]) + call assert_match('^\s*2\s\+\d\+\.\d\+\s\+Foo1()$', lines[21]) + call assert_equal('', lines[22]) + call assert_equal('FUNCTIONS SORTED ON SELF TIME', lines[23]) + call assert_equal('count total (s) self (s) function', lines[24]) + call assert_match('^\s*1\s\+\d\+\.\d\+\s\+Foo2()$', lines[25]) + call assert_match('^\s*2\s\+\d\+\.\d\+\s\+Foo1()$', lines[26]) + call assert_equal('', lines[27]) call delete('Xprofile_func.vim') call delete('Xprofile_func.log') endfunc func Test_profile_file() - if !has('unix') - return - endif let lines = [ \ 'func! Foo()', \ 'endfunc', @@ -87,13 +96,14 @@ func Test_profile_file() \ ] call writefile(lines, 'Xprofile_file.vim') - let a = system(v:progpath - \ . " -u NONE -i NONE --noplugin" - \ . " -c 'profile start Xprofile_file.log'" - \ . " -c 'profile file Xprofile_file.vim'" - \ . " -c 'so Xprofile_file.vim'" - \ . " -c 'so Xprofile_file.vim'" - \ . " -c 'qall!'") + call system(v:progpath + \ . ' -es -u NONE -U NONE -i NONE --noplugin' + \ . ' -c "profile start Xprofile_file.log"' + \ . ' -c "profile file Xprofile_file.vim"' + \ . ' -c "so Xprofile_file.vim"' + \ . ' -c "so Xprofile_file.vim"' + \ . ' -c "qall!"') + call assert_equal(0, v:shell_error) let lines = readfile('Xprofile_file.log') diff --git a/src/version.c b/src/version.c index 28c677696a..b0f1c22451 100644 --- a/src/version.c +++ b/src/version.c @@ -764,6 +764,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 196, /**/ 195, /**/ From 97d62d4321df358665e2e6504aad8ac2ba7fd841 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Mon, 16 Jan 2017 22:53:57 +0100 Subject: [PATCH 10/20] patch 8.0.0197: system() test skips some parts for MS-Windows Problem: On MS-Windows the system() test skips a few parts. Solution: Swap single and double quotes for the command. --- src/testdir/test_system.vim | 63 +++++++++++++++++++------------------ src/version.c | 2 ++ 2 files changed, 35 insertions(+), 30 deletions(-) diff --git a/src/testdir/test_system.vim b/src/testdir/test_system.vim index a7de57aacc..d6886b0f0c 100644 --- a/src/testdir/test_system.vim +++ b/src/testdir/test_system.vim @@ -48,42 +48,45 @@ function! Test_System() endfunction function! Test_system_exmode() - if !has('unix') - return + if has('unix') " echo $? only works on Unix + let cmd = ' -es -u NONE -c "source Xscript" +q; echo $?' + " Need to put this in a script, "catch" isn't found after an unknown + " function. + call writefile(['try', 'call doesnotexist()', 'catch', 'endtry'], 'Xscript') + let a = system(v:progpath . cmd) + call assert_equal('0', a[0]) + call assert_equal(0, v:shell_error) endif - let cmd=" -es -u NONE -c 'source Xscript' +q; echo $?" - " Need to put this in a script, "catch" isn't found after an unknown - " function. - call writefile(['try', 'call doesnotexist()', 'catch', 'endtry'], 'Xscript') - let a = system(v:progpath . cmd) - call assert_equal('0', a[0]) - call assert_equal(0, v:shell_error) - " Error before try does set error flag. call writefile(['call nosuchfunction()', 'try', 'call doesnotexist()', 'catch', 'endtry'], 'Xscript') - let a = system(v:progpath . cmd) - call assert_notequal('0', a[0]) + if has('unix') " echo $? only works on Unix + let a = system(v:progpath . cmd) + call assert_notequal('0', a[0]) + endif - let cmd=" -es -u NONE -c 'source Xscript' +q" + let cmd = ' -es -u NONE -c "source Xscript" +q' let a = system(v:progpath . cmd) call assert_notequal(0, v:shell_error) - - let cmd=" -es -u NONE -c 'call doesnotexist()' +q; echo $?" - let a = system(v:progpath. cmd) - call assert_notequal(0, a[0]) - - let cmd=" -es -u NONE -c 'call doesnotexist()' +q" - let a = system(v:progpath. cmd) - call assert_notequal(0, v:shell_error) - - let cmd=" -es -u NONE -c 'call doesnotexist()|let a=1' +q; echo $?" - let a = system(v:progpath. cmd) - call assert_notequal(0, a[0]) - - let cmd=" -es -u NONE -c 'call doesnotexist()|let a=1' +q" - let a = system(v:progpath. cmd) - call assert_notequal(0, v:shell_error) - call delete('Xscript') + + if has('unix') " echo $? only works on Unix + let cmd = ' -es -u NONE -c "call doesnotexist()" +q; echo $?' + let a = system(v:progpath. cmd) + call assert_notequal(0, a[0]) + endif + + let cmd = ' -es -u NONE -c "call doesnotexist()" +q' + let a = system(v:progpath. cmd) + call assert_notequal(0, v:shell_error) + + if has('unix') " echo $? only works on Unix + let cmd = ' -es -u NONE -c "call doesnotexist()|let a=1" +q; echo $?' + let a = system(v:progpath. cmd) + call assert_notequal(0, a[0]) + endif + + let cmd = ' -es -u NONE -c "call doesnotexist()|let a=1" +q' + let a = system(v:progpath. cmd) + call assert_notequal(0, v:shell_error) endfunc diff --git a/src/version.c b/src/version.c index b0f1c22451..71c04506f5 100644 --- a/src/version.c +++ b/src/version.c @@ -764,6 +764,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 197, /**/ 196, /**/ From 369b6f57c426b4bf39b4a0cac8d21ed1b5f7de4d Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Tue, 17 Jan 2017 12:22:32 +0100 Subject: [PATCH 11/20] Update runtime files. --- runtime/doc/autocmd.txt | 4 +-- runtime/doc/eval.txt | 5 +-- runtime/doc/options.txt | 5 +-- runtime/doc/starting.txt | 5 +-- runtime/doc/tags | 2 ++ runtime/doc/todo.txt | 41 +++++++----------------- runtime/doc/version8.txt | 3 +- runtime/filetype.vim | 10 ++++-- runtime/syntax/css.vim | 5 +-- runtime/syntax/debchangelog.vim | 4 +-- runtime/syntax/debcontrol.vim | 2 +- runtime/syntax/debsources.vim | 4 +-- runtime/tutor/tutor.fr | 12 +++---- runtime/tutor/tutor.fr.utf-8 | 12 +++---- src/po/eo.po | 54 +++++++++++++++---------------- src/po/fr.po | 57 ++++++++++++++++----------------- 16 files changed, 107 insertions(+), 118 deletions(-) diff --git a/runtime/doc/autocmd.txt b/runtime/doc/autocmd.txt index b901f21024..c6358e4eb9 100644 --- a/runtime/doc/autocmd.txt +++ b/runtime/doc/autocmd.txt @@ -1,4 +1,4 @@ -*autocmd.txt* For Vim version 8.0. Last change: 2016 Sep 27 +*autocmd.txt* For Vim version 8.0. Last change: 2017 Jan 14 VIM REFERENCE MANUAL by Bram Moolenaar @@ -33,7 +33,7 @@ files matching *.c. You can also use autocommands to implement advanced features, such as editing compressed files (see |gzip-example|). The usual place to put autocommands is in your .vimrc or .exrc file. - *E203* *E204* *E143* *E855* + *E203* *E204* *E143* *E855* *E937* WARNING: Using autocommands is very powerful, and may lead to unexpected side effects. Be careful not to destroy your text. - It's a good idea to do some testing on an expendable copy of a file first. diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index a53b5d23db..ec4030e2bb 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -1,4 +1,4 @@ -*eval.txt* For Vim version 8.0. Last change: 2017 Jan 08 +*eval.txt* For Vim version 8.0. Last change: 2017 Jan 14 VIM REFERENCE MANUAL by Bram Moolenaar @@ -5256,6 +5256,7 @@ json_decode({string}) *json_decode()* - A trailing comma in an array and object is ignored. - More floating point numbers are recognized, e.g. "1." for "1.0". + However, a duplicate key in an object is not allowed. *E938* The result must be a valid Vim type: - An empty object member name is not allowed. - Duplicate object member names are not allowed. @@ -7249,7 +7250,7 @@ strcharpart({src}, {start}[, {len}]) *strcharpart()* Like |strpart()| but using character index and length instead of byte index and length. When a character index is used where a character does not - exist it is assumed to be one byte. For example: > + exist it is assumed to be one character. For example: > strcharpart('abc', -1, 2) < results in 'a'. diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt index 88dca60b77..a9a0cc4835 100644 --- a/runtime/doc/options.txt +++ b/runtime/doc/options.txt @@ -1,4 +1,4 @@ -*options.txt* For Vim version 8.0. Last change: 2017 Jan 02 +*options.txt* For Vim version 8.0. Last change: 2017 Jan 15 VIM REFERENCE MANUAL by Bram Moolenaar @@ -5144,7 +5144,7 @@ A jump table for the options with a short description can be found at |Q_op|. {not in Vi} *E21* When off the buffer contents cannot be changed. The 'fileformat' and 'fileencoding' options also can't be changed. - Can be reset with the |-M| command line argument. + Can be reset on startup with the |-M| command line argument. *'modified'* *'mod'* *'nomodified'* *'nomod'* 'modified' 'mod' boolean (default off) @@ -5809,6 +5809,7 @@ A jump table for the options with a short description can be found at |Q_op|. buffer, unless the 'Z' flag is in 'cpoptions'. {not in Vi:} When using the ":view" command the 'readonly' option is set for the newly edited buffer. + See 'modifiable' for disallowing changes to the buffer. *'redrawtime'* *'rdt'* 'redrawtime' 'rdt' number (default 2000) diff --git a/runtime/doc/starting.txt b/runtime/doc/starting.txt index 49b1407b07..eb1fdc8951 100644 --- a/runtime/doc/starting.txt +++ b/runtime/doc/starting.txt @@ -1,4 +1,4 @@ -*starting.txt* For Vim version 8.0. Last change: 2016 Nov 24 +*starting.txt* For Vim version 8.0. Last change: 2017 Jan 15 VIM REFERENCE MANUAL by Bram Moolenaar @@ -230,6 +230,7 @@ a slash. Thus "-R" means recovery and "-/R" readonly. the executable "view" has the same effect as the -R argument. The 'updatecount' option will be set to 10000, meaning that the swap file will not be updated automatically very often. + See |-M| for disallowing modifications. *-m* -m Modifications not allowed to be written. The 'write' option @@ -1219,7 +1220,7 @@ There are several ways to exit Vim: - Use `:cquit`. Also when there are changes. When using `:cquit` or when there was an error message Vim exits with exit -code 1. Errors can be avoided by using `:silent!`. +code 1. Errors can be avoided by using `:silent!` or with `:catch`. ============================================================================== 8. Saving settings *save-settings* diff --git a/runtime/doc/tags b/runtime/doc/tags index 0031975068..8bd61e5205 100644 --- a/runtime/doc/tags +++ b/runtime/doc/tags @@ -4488,6 +4488,8 @@ E933 eval.txt /*E933* E934 sign.txt /*E934* E935 eval.txt /*E935* E936 autocmd.txt /*E936* +E937 autocmd.txt /*E937* +E938 eval.txt /*E938* E94 windows.txt /*E94* E95 message.txt /*E95* E96 diff.txt /*E96* diff --git a/runtime/doc/todo.txt b/runtime/doc/todo.txt index 772d107f7c..d324607c73 100644 --- a/runtime/doc/todo.txt +++ b/runtime/doc/todo.txt @@ -1,4 +1,4 @@ -*todo.txt* For Vim version 8.0. Last change: 2017 Jan 09 +*todo.txt* For Vim version 8.0. Last change: 2017 Jan 16 VIM REFERENCE MANUAL by Bram Moolenaar @@ -35,6 +35,8 @@ entered there will not be repeated below, unless there is extra information. *known-bugs* -------------------- Known bugs and current work ----------------------- +get_syn_options() does not respect skip in else part. (Zyx) + +channel: - Try out background make plugin: https://github.com/AndrewVos/vim-make-background @@ -120,28 +122,10 @@ What if there is an invalid character? Include rust files. (Klabnik, #1356) -More float tests. (Dominique, #1364) - -Patch to avoid ubsan warning for integer overflow. (Dominique, 2016 Dec 26) - -Bug: Json with same key should not give internal error. (Lcd, 2016 Oct 26) -Make dict_add give a duplicate key error. - -Patch to make str2nr and str2float work with signed values. -(Lemonbody, 2016 Dec 18, #1332) - -Should json_encode()/json_decode() restrict recursiveness? -Or avoid recursiveness. - -Patch to fix UBSan error. Is this actually needed? -(Yegappan, 2016 Dec 18) - Allow using json with empty key? Dict already has it. Json string with trailing \u should be an error. (Lcd) -Patch to reset ex_exitvalue after catch. (Christian Brabandt, 2016 Oct 23) - Patch to deal with changed configure events in GTK 3. (Jan Alexander Steffens, 2016 Oct 23 #1193) Remarks from nuko8, 2016 Nov 2. @@ -159,6 +143,9 @@ Patch for :pyx, run python commands depending on the supported version. Patch to avoid warnings for overflow. (Mike Williams, 2016 Dec 16) Update Dec 19. +When an item in the quickfix list has a file name that does not exist, behave +like the item was not a match for :cnext. + Wrong diff highlighting with three files. (2016 Oct 20, #1186) Also get E749 on exit. Another example in #1309 @@ -219,9 +206,6 @@ Or point to nightly builds: https://github.com/vim/vim-win32-installer/releases Problem passing non-UTF-8 strings to Python 3. (Björn Linse, 2016 Sep 11, #1053) With patch, does it work? -Patch to make finding duplicate tags much faster, using a hashtab. (James -McCoy, 2016 Sept 14, #1046) Should work now. Updated Nov 12. -> Use ADDR_OTHER instead of ADDR_LINES for many more commands. Add tests for using number larger than number of lines in buffer. @@ -251,6 +235,9 @@ Patch to make it possible to extend a list with itself. Patch to add Zstandard compressed file support. (Nick Terrell, 2016 Oct 24) +Patch to add new regexp classes :ident:, :keyword:, :fname:. +(ichizok, 2016 Jan 12, #1373) + Patch to add trim() function. (Bukn, 2016 Nov 25, #1280) Patch to add MODIFIED_BY to MSVC build file. (Chen Lei, 2016 Nov 24, #1275) @@ -475,6 +462,9 @@ Should use /usr/local/share/applications or /usr/share/applications. Or use $XDG_DATA_DIRS. Also need to run update-desktop-database (Kuriyama Kazunobu, 2015 Nov 4) +Test object i{ and it do not behave the same. #1379 +Do not include the linebreak at the start? + Patch to have text objects defined by arbitrary single characters. (Daniel Thau, 2013 Nov 20, 2014 Jan 29, 2014 Jan 31) Added tests (James McCoy, 2016 Aug 3). Still needs more work. @@ -972,11 +962,6 @@ highlighted as the cursor line. (Alessandro Ivaldi, 2013 Jun 4) Two highlighting bugs. (ZyX, 2013 Aug 18) -Patch to add the bufferlist() function. (Yegappan Lakshmanan, 2013 May 5) -May 17: with winlist() and tabpagelist(). -May 19: with local variables. -May 28: with options - Patch to support 'u' in interactive substitute. (Christian Brabandt, 2012 Sep 28) With tests: Oct 9. @@ -1219,8 +1204,6 @@ right type. string() can't parse back "inf" and "nan". Fix documentation or fix code? (ZyX, 2010 Aug 23) -Make 'formatprg' global-local. (Sung Pae) - When doing "redir => s:foo" in a script and then "redir END" somewhere else (e.g. in a function) it can't find s:foo. When a script contains "redir => s:foo" but doesn't end redirection, a diff --git a/runtime/doc/version8.txt b/runtime/doc/version8.txt index 9cf047bb7a..4b0275597c 100644 --- a/runtime/doc/version8.txt +++ b/runtime/doc/version8.txt @@ -1,4 +1,4 @@ -*version8.txt* For Vim version 8.0. Last change: 2016 Dec 10 +*version8.txt* For Vim version 8.0. Last change: 2017 Jan 15 VIM REFERENCE MANUAL by Bram Moolenaar @@ -230,6 +230,7 @@ Ex commands: ~ Ex command modifiers: ~ |:keeppatterns| following command keeps search pattern history +|| supply command modifiers to user defined commands New and extended functions: ~ diff --git a/runtime/filetype.vim b/runtime/filetype.vim index 9c9c808b47..dba6784e1a 100644 --- a/runtime/filetype.vim +++ b/runtime/filetype.vim @@ -676,8 +676,14 @@ au BufNewFile,BufRead *.dtd setf dtd " DTS/DSTI (device tree files) au BufNewFile,BufRead *.dts,*.dtsi setf dts -" EDIF (*.edf,*.edif,*.edn,*.edo) -au BufNewFile,BufRead *.ed\(f\|if\|n\|o\) setf edif +" EDIF (*.edf,*.edif,*.edn,*.edo) or edn +au BufNewFile,BufRead *.ed\(f\|if\|o\) setf edif +au BufNewFile,BufRead *.edn + \ if getline(1) =~ '^\s*(\s*edif\>' | + \ setf edif | + \ else | + \ setf clojure | + \ endif " EditorConfig (close enough to dosini) au BufNewFile,BufRead .editorconfig setf dosini diff --git a/runtime/syntax/css.vim b/runtime/syntax/css.vim index 3dc3f5c2d6..23db7b10e8 100644 --- a/runtime/syntax/css.vim +++ b/runtime/syntax/css.vim @@ -6,7 +6,8 @@ " Nikolai Weibull (Add CSS2 support) " Maintainer: Jules Wang " URL: https://github.com/JulesWang/css.vim -" Last Change: 2015 Apr.17 +" Last Change: 2017 Jan 14 +" cssClassName updated by Ryuichi Hayashida Jan 2016 " quit when a syntax file was already loaded if !exists("main_syntax") @@ -56,7 +57,7 @@ syn match cssSelectorOp2 "[~|^$*]\?=" contained syn region cssAttributeSelector matchgroup=cssSelectorOp start="\[" end="]" contains=cssUnicodeEscape,cssSelectorOp2,cssStringQ,cssStringQQ " .class and #id -syn match cssClassName "\.[A-Za-z][A-Za-z0-9_-]\+" contains=cssClassNameDot +syn match cssClassName "\.-\=[A-Za-z_][A-Za-z0-9_-]*" contains=cssClassNameDot syn match cssClassNameDot contained '\.' try diff --git a/runtime/syntax/debchangelog.vim b/runtime/syntax/debchangelog.vim index a10e4ad342..eb02aaf4af 100644 --- a/runtime/syntax/debchangelog.vim +++ b/runtime/syntax/debchangelog.vim @@ -3,7 +3,7 @@ " Maintainer: Debian Vim Maintainers " Former Maintainers: Gerfried Fuchs " Wichert Akkerman -" Last Change: 2016 Aug 30 +" Last Change: 2016 Nov 12 " URL: https://anonscm.debian.org/cgit/pkg-vim/vim.git/plain/runtime/syntax/debchangelog.vim " Standard syntax initialization @@ -21,7 +21,7 @@ let binNMU='binary-only=yes' syn match debchangelogName contained "^[[:alnum:]][[:alnum:].+-]\+ " exe 'syn match debchangelogFirstKV contained "; \('.urgency.'\|'.binNMU.'\)"' exe 'syn match debchangelogOtherKV contained ", \('.urgency.'\|'.binNMU.'\)"' -syn match debchangelogTarget contained "\v %(frozen|unstable|sid|%(testing|%(old)=stable)%(-proposed-updates|-security)=|experimental|squeeze-%(backports%(-sloppy)=|volatile|lts|security)|wheezy-%(backports%(-sloppy)=|security)|jessie%(-backports|-security)=|stretch|%(devel|precise|trusty|vivid|wily|xenial|yakkety)%(-%(security|proposed|updates|backports|commercial|partner))=)+" +syn match debchangelogTarget contained "\v %(frozen|unstable|sid|%(testing|%(old)=stable)%(-proposed-updates|-security)=|experimental|squeeze-%(backports%(-sloppy)=|volatile|lts|security)|wheezy-%(backports%(-sloppy)=|security)|jessie%(-backports|-security)=|stretch|%(devel|precise|trusty|vivid|wily|xenial|yakkety|zesty)%(-%(security|proposed|updates|backports|commercial|partner))=)+" syn match debchangelogVersion contained "(.\{-})" syn match debchangelogCloses contained "closes:\_s*\(bug\)\=#\=\_s\=\d\+\(,\_s*\(bug\)\=#\=\_s\=\d\+\)*" syn match debchangelogLP contained "\clp:\s\+#\d\+\(,\s*#\d\+\)*" diff --git a/runtime/syntax/debcontrol.vim b/runtime/syntax/debcontrol.vim index b52c496c95..b1bc9f8bfe 100644 --- a/runtime/syntax/debcontrol.vim +++ b/runtime/syntax/debcontrol.vim @@ -38,7 +38,7 @@ unlet s:kernels s:archs s:pairs syn match debcontrolMultiArch contained "\%(no\|foreign\|allowed\|same\)" syn match debcontrolName contained "[a-z0-9][a-z0-9+.-]\+" syn match debcontrolPriority contained "\(extra\|important\|optional\|required\|standard\)" -syn match debcontrolSection contained "\v((contrib|non-free|non-US/main|non-US/contrib|non-US/non-free|restricted|universe|multiverse)/)?(admin|cli-mono|comm|database|debian-installer|debug|devel|doc|editors|education|electronics|embedded|fonts|games|gnome|gnustep|gnu-r|graphics|hamradio|haskell|httpd|interpreters|introspection|java|kde|kernel|libs|libdevel|lisp|localization|mail|math|metapackages|misc|net|news|ocaml|oldlibs|otherosfs|perl|php|python|ruby|science|shells|sound|text|tex|utils|vcs|video|web|x11|xfce|zope)" +syn match debcontrolSection contained "\v((contrib|non-free|non-US/main|non-US/contrib|non-US/non-free|restricted|universe|multiverse)/)?(admin|cli-mono|comm|database|debian-installer|debug|devel|doc|editors|education|electronics|embedded|fonts|games|gnome|gnustep|gnu-r|graphics|hamradio|haskell|httpd|interpreters|introspection|java|javascript|kde|kernel|libs|libdevel|lisp|localization|mail|math|metapackages|misc|net|news|ocaml|oldlibs|otherosfs|perl|php|python|ruby|rust|science|shells|sound|text|tex|utils|vcs|video|web|x11|xfce|zope)" syn match debcontrolPackageType contained "u\?deb" syn match debcontrolVariable contained "\${.\{-}}" syn match debcontrolDmUpload contained "\cyes" diff --git a/runtime/syntax/debsources.vim b/runtime/syntax/debsources.vim index 2777944971..390c43035e 100644 --- a/runtime/syntax/debsources.vim +++ b/runtime/syntax/debsources.vim @@ -2,7 +2,7 @@ " Language: Debian sources.list " Maintainer: Debian Vim Maintainers " Former Maintainer: Matthijs Mohlmann -" Last Change: 2016 Sep 27 +" Last Change: 2016 Nov 12 " URL: https://anonscm.debian.org/cgit/pkg-vim/vim.git/plain/runtime/syntax/debsources.vim " Standard syntax initialization @@ -25,7 +25,7 @@ let s:supported = [ \ 'oldstable', 'stable', 'testing', 'unstable', 'experimental', \ 'squeeze', 'wheezy', 'jessie', 'stretch', 'sid', 'rc-buggy', \ - \ 'precise', 'trusty', 'xenial', 'yakkety', 'devel' + \ 'precise', 'trusty', 'xenial', 'yakkety', 'zesty', 'devel' \ ] let s:unsupported = [ \ 'buzz', 'rex', 'bo', 'hamm', 'slink', 'potato', diff --git a/runtime/tutor/tutor.fr b/runtime/tutor/tutor.fr index ef2d847dca..cdfdcd665b 100644 --- a/runtime/tutor/tutor.fr +++ b/runtime/tutor/tutor.fr @@ -123,7 +123,7 @@ NOTE : En avan Leçon 1.5 : ÉDITION DE TEXTE - AJOUTER - ** Appuyez A pour ajouter du text. ** + ** Appuyez A pour ajouter du texte. ** 1. Déplacez le curseur sur la première ligne ci-dessous marquée --->. Peu importe sur quel caractère se trouve le curseur sur cette ligne. @@ -574,7 +574,7 @@ NOTE : Quand la recherche atteint la fin du fichier, elle reprend au d 2. Puis tapez le caractère % . - 3. Le curseur se déplacera sur la parenthèse out crochet correspondant. + 3. Le curseur se déplacera sur la parenthèse ou crochet correspondant. 4. Tapez % pour replacer le curseur sur la parenthèse ou crochet correspondant. @@ -854,17 +854,17 @@ NOTE : Le mode Remplacement est comme le mode Insertion, mais tous les 5. Tapez p pour coller le texte. Puis tapez : un second <Échap> . 6. Utilisez le mode Visuel pour sélectionner "élément", copiez-le avec y , - déplacez-vous à la fin de la ligne suivant avec j$ et collez le texte + déplacez-vous à la fin de la ligne suivante avec j$ et collez le texte à cet endroit avec p . ---> a) ceci est le premier élément. b) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leçon 6.4 : RÉGLAGE DES OPTIONS + Leçon 6.5 : RÉGLAGE DES OPTIONS - ** Réglons une option afin que la recherche et la substitution ignore la + ** Réglons une option afin que la recherche et la substitution ignorent la casse des caractères. ** 1. Recherchez 'ignore' en tapant : /ignore @@ -1034,5 +1034,5 @@ NOTE : Le compl Dernières mises à jour par Dominique Pellé. E-mail : dominique.pelle@gmail.com - Last Change : 2016 Nov 08 + Last Change : 2017 Jan 16 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/runtime/tutor/tutor.fr.utf-8 b/runtime/tutor/tutor.fr.utf-8 index 4e42fd3cb9..0ec32879c6 100644 --- a/runtime/tutor/tutor.fr.utf-8 +++ b/runtime/tutor/tutor.fr.utf-8 @@ -123,7 +123,7 @@ NOTE : En avançant dans ce cours, n'essayez pas de mémoriser, apprenez par Leçon 1.5 : ÉDITION DE TEXTE - AJOUTER - ** Appuyez A pour ajouter du text. ** + ** Appuyez A pour ajouter du texte. ** 1. Déplacez le curseur sur la première ligne ci-dessous marquée --->. Peu importe sur quel caractère se trouve le curseur sur cette ligne. @@ -574,7 +574,7 @@ NOTE : Quand la recherche atteint la fin du fichier, elle reprend au début 2. Puis tapez le caractère % . - 3. Le curseur se déplacera sur la parenthèse out crochet correspondant. + 3. Le curseur se déplacera sur la parenthèse ou crochet correspondant. 4. Tapez % pour replacer le curseur sur la parenthèse ou crochet correspondant. @@ -854,17 +854,17 @@ NOTE : Le mode Remplacement est comme le mode Insertion, mais tous les 5. Tapez p pour coller le texte. Puis tapez : un second <Échap> . 6. Utilisez le mode Visuel pour sélectionner "élément", copiez-le avec y , - déplacez-vous à la fin de la ligne suivant avec j$ et collez le texte + déplacez-vous à la fin de la ligne suivante avec j$ et collez le texte à cet endroit avec p . ---> a) ceci est le premier élément. b) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leçon 6.4 : RÉGLAGE DES OPTIONS + Leçon 6.5 : RÉGLAGE DES OPTIONS - ** Réglons une option afin que la recherche et la substitution ignore la + ** Réglons une option afin que la recherche et la substitution ignorent la casse des caractères. ** 1. Recherchez 'ignore' en tapant : /ignore @@ -1034,5 +1034,5 @@ NOTE : Le complètement fonctionne pour de nombreuses commandes. Essayez Dernières mises à jour par Dominique Pellé. E-mail : dominique.pelle@gmail.com - Last Change : 2016 Nov 08 + Last Change : 2017 Jan 16 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/src/po/eo.po b/src/po/eo.po index c8915271cd..3fb300c63f 100644 --- a/src/po/eo.po +++ b/src/po/eo.po @@ -5,7 +5,7 @@ # # UNUA TRADUKISTO Dominique PELLE # PROVLEGANTO(J) Felipe CASTRO -# Antono MECHELYNCK +# Antono MECHELYNCK # Yves NEVELSTEEN # # Uzitaj vortaroj kaj fakvortaroj: @@ -23,8 +23,8 @@ msgid "" msgstr "" "Project-Id-Version: Vim(Esperanto)\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2016-08-26 20:54+0200\n" -"PO-Revision-Date: 2016-08-26 20:30+0200\n" +"POT-Creation-Date: 2017-01-16 00:30+0100\n" +"PO-Revision-Date: 2017-01-16 01:14+0100\n" "Last-Translator: Dominique PELLÉ \n" "Language-Team: \n" "Language: eo\n" @@ -66,6 +66,9 @@ msgstr "E83: Ne eblas disponigi bufron, nun uzas alian..." msgid "E931: Buffer cannot be registered" msgstr "E931: Bufro ne povas esti registrita" +msgid "E937: Attempt to delete a buffer that is in use" +msgstr "E937: Provo de forviÅo de bufro, kiu estas uzanta" + msgid "E515: No buffers were unloaded" msgstr "E515: Neniu bufro estis malÅargita" @@ -269,7 +272,7 @@ msgid "E918: buffer must be loaded: %s" msgstr "E918: bufro devas esti Åargita: %s" msgid "E821: File is encrypted with unknown method" -msgstr "E821: Dosiero estas ĉifrata per nekonata metodo" +msgstr "E821: Dosiero estas ĉifrita per nekonata metodo" msgid "Warning: Using a weak encryption method; see :help 'cm'" msgstr "Averto: uzo de malfortika ĉifrada metodo; vidu :help 'cm'" @@ -1963,6 +1966,9 @@ msgstr "E462: Ne eblis prepari por reÅargi \"%s\"" msgid "E321: Could not reload \"%s\"" msgstr "E321: Ne eblis reÅargi \"%s\"" +msgid "--Deleted--" +msgstr "--ForviÅita--" + #, c-format msgid "auto-removing autocommand: %s " msgstr "aÅ­to-forviÅas aÅ­tokomandon: %s " @@ -1972,12 +1978,12 @@ msgstr "aÅ­to-forviÅas aÅ­tokomandon: %s " msgid "E367: No such group: \"%s\"" msgstr "E367: Ne ekzistas tia grupo: \"%s\"" +msgid "E936: Cannot delete the current group" +msgstr "E936: Ne eblas forviÅi la aktualan grupon" + msgid "W19: Deleting augroup that is still in use" msgstr "W19: ForviÅo de augroup kiu estas ankoraÅ­ uzata" -msgid "--Deleted--" -msgstr "--ForviÅita--" - #, c-format msgid "E215: Illegal character after *: %s" msgstr "E215: Nevalida signo post *: %s" @@ -2834,6 +2840,10 @@ msgid "E251: VIM instance registry property is badly formed. Deleted!" msgstr "" "E251: Ecoj de registro de apero de VIM estas nevalide formata. ForviÅita!" +#, c-format +msgid "E938: Duplicate key in JSON: \"%s\"" +msgstr "E938: Ripetita Ålosilo en JSON: \"%s\"" + #, c-format msgid "E696: Missing comma in List: %s" msgstr "E696: Mankas komo en Listo: %s" @@ -3058,6 +3068,10 @@ msgid "--not-a-term\t\tSkip warning for input/output not being a terminal" msgstr "" "--not-a-term\t\tPreterpasi averton por enigo/eligo, kiu ne estas terminalo" +msgid "--ttyfail\t\tExit if input or output is not a terminal" +msgstr "" +"--ttyfail\t\tEliri se le eniro aÅ­ eliro ne estas terminalo" + msgid "-u \t\tUse instead of any .vimrc" msgstr "-u \t\tUzi anstataÅ­ iun ajn .vimrc" @@ -4454,9 +4468,6 @@ msgstr "ERARO DE ENIGO/ELIGO" msgid "Message" msgstr "MesaÄo" -msgid "'columns' is not 80, cannot execute external commands" -msgstr "'columns' ne estas 80, ne eblas plenumi eksterajn komandojn" - msgid "E237: Printer selection failed" msgstr "E237: Elekto de presilo malsukcesis" @@ -5998,14 +6009,6 @@ msgstr "E133: \":return\" ekster funkcio" msgid "E107: Missing parentheses: %s" msgstr "E107: Mankas krampoj: %s" -#. Only MS VC 4.1 and earlier can do Win32s -msgid "" -"\n" -"MS-Windows 16/32-bit GUI version" -msgstr "" -"\n" -"Grafika versio MS-Vindozo 16/32-bitoj" - msgid "" "\n" "MS-Windows 64-bit GUI version" @@ -6305,13 +6308,6 @@ msgstr "tajpu :help register por pliaj informoj " msgid "menu Help->Sponsor/Register for information " msgstr "menuo Helpo->Subteni/Registri por pliaj informoj " -msgid "WARNING: Windows 95/98/ME detected" -msgstr "AVERTO: Trovis Vindozon 95/98/ME" - -# DP: atentu al la spacetoj: ĉiuj ĉenoj devas havi la saman longon -msgid "type :help windows95 for info on this" -msgstr "tajpu :help windows95 por pliaj informoj " - msgid "Already only one window" msgstr "Jam nur unu fenestro" @@ -6465,6 +6461,10 @@ msgstr "E236: La tiparo \"%s\" ne estas egallarÄa" msgid "E473: Internal error" msgstr "E473: Interna eraro" +#, c-format +msgid "E685: Internal error: %s" +msgstr "E685: Interna eraro: %s" + msgid "Interrupted" msgstr "Interrompita" @@ -6745,10 +6745,6 @@ msgstr "E463: Regiono estas gardita, ne eblas ÅanÄi" msgid "E744: NetBeans does not allow changes in read-only files" msgstr "E744: NetBeans ne permesas ÅanÄojn en nurlegeblaj dosieroj" -#, c-format -msgid "E685: Internal error: %s" -msgstr "E685: Interna eraro: %s" - msgid "E363: pattern uses more memory than 'maxmempattern'" msgstr "E363: Åablono uzas pli da memoro ol 'maxmempattern'" diff --git a/src/po/fr.po b/src/po/fr.po index 171a907a51..05b2fa0e66 100644 --- a/src/po/fr.po +++ b/src/po/fr.po @@ -6,7 +6,7 @@ # FIRST AUTHOR DindinX 2000. # SECOND AUTHOR Adrien Beau 2002, 2003. # THIRD AUTHOR David Blanchet 2006, 2008. -# FOURTH AUTHOR Dominique Pellé 2008, 2016. +# FOURTH AUTHOR Dominique Pellé 2008, 2017. # # Latest translation available at: # http://dominique.pelle.free.fr/vim-fr.php @@ -15,8 +15,8 @@ msgid "" msgstr "" "Project-Id-Version: Vim(Français)\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2016-08-26 20:54+0200\n" -"PO-Revision-Date: 2016-08-26 20:34+0200\n" +"POT-Creation-Date: 2017-01-16 00:30+0100\n" +"PO-Revision-Date: 2017-01-16 00:51+0100\n" "Last-Translator: Dominique Pellé \n" "Language-Team: \n" "Language: fr\n" @@ -63,6 +63,9 @@ msgstr "" msgid "E931: Buffer cannot be registered" msgstr "E931: Le tampon ne peut pas être enregistré" +msgid "E937: Attempt to delete a buffer that is in use" +msgstr "E937: Tentative de suppression d'un tampon en cours d'utilisation" + msgid "E515: No buffers were unloaded" msgstr "E515: Aucun tampon n'a été déchargé" @@ -242,7 +245,7 @@ msgid "E898: socket() in channel_open()" msgstr "E898: socket() dans channel_open()" msgid "E903: received command with non-string argument" -msgstr "E903: commande reçue avec une argument qui n'est pas une chaîne" +msgstr "E903: commande reçue avec un argument qui n'est pas une chaîne" msgid "E904: last argument for expr/call must be a number" msgstr "E904: le dernier argument de expr/call doit être un nombre" @@ -2150,6 +2153,9 @@ msgstr "E462: Impossible de pr msgid "E321: Could not reload \"%s\"" msgstr "E321: Impossible de recharger \"%s\"" +msgid "--Deleted--" +msgstr "--Effacé--" + #, c-format msgid "auto-removing autocommand: %s " msgstr "Autocommandes marquées pour auto-suppression : %s " @@ -2159,12 +2165,12 @@ msgstr "Autocommandes marqu msgid "E367: No such group: \"%s\"" msgstr "E367: Aucun groupe \"%s\"" +msgid "E936: Cannot delete the current group" +msgstr "E936: Impossible de supprimer le groupe courant" + msgid "W19: Deleting augroup that is still in use" msgstr "W19: Effacement d'augroup toujours en usage" -msgid "--Deleted--" -msgstr "--Effacé--" - #, c-format msgid "E215: Illegal character after *: %s" msgstr "E215: Caractère non valide après * : %s" @@ -2854,7 +2860,7 @@ msgid "invalid expression" msgstr "expression invalide" msgid "expressions disabled at compile time" -msgstr "expressions désactivée lors de la compilation" +msgstr "expressions désactivées lors de la compilation" msgid "hidden option" msgstr "option cachée" @@ -3041,6 +3047,10 @@ msgstr "E573: Id utilis msgid "E251: VIM instance registry property is badly formed. Deleted!" msgstr "E251: Entrée registre de l'instance de Vim mal formatée. Suppression !" +#, c-format +msgid "E938: Duplicate key in JSON: \"%s\"" +msgstr "E938: Clé dupliquée dans le document JSON : \"%s\"" + #, c-format msgid "E696: Missing comma in List: %s" msgstr "E696: Il manque une virgule dans la Liste %s" @@ -3269,6 +3279,10 @@ msgid "--not-a-term\t\tSkip warning for input/output not being a terminal" msgstr "" "--no-a-term\t\tAucun avertissement si l'entrée/sortie n'est pas un terminal" +msgid "--ttyfail\t\tExit if input or output is not a terminal" +msgstr "" +"--ttyfail\t\tQuitte si l'entrée ou la sortie ne sont pas un terminal" + msgid "-u \t\tUse instead of any .vimrc" msgstr "-u \tUtiliser au lieu du vimrc habituel" @@ -4682,9 +4696,6 @@ msgstr "ERREUR d'E/S" msgid "Message" msgstr "Message" -msgid "'columns' is not 80, cannot execute external commands" -msgstr "'columns' ne vaut pas 80, impossible d'exécuter des commandes externes" - msgid "E237: Printer selection failed" msgstr "E237: La sélection de l'imprimante a échoué" @@ -5625,7 +5636,7 @@ msgstr "" #. This should have been checked when generating the .spl #. * file. msgid "E783: duplicate char in MAP entry" -msgstr "E783: caractères dupliqué dans l'entrée MAP" +msgstr "E783: caractère dupliqué dans l'entrée MAP" msgid "No Syntax items defined for this buffer" msgstr "Aucun élément de syntaxe défini pour ce tampon" @@ -6264,14 +6275,6 @@ msgstr "E133: :return en dehors d'une fonction" msgid "E107: Missing parentheses: %s" msgstr "E107: Parenthèses manquantes : %s" -#. Only MS VC 4.1 and earlier can do Win32s -msgid "" -"\n" -"MS-Windows 16/32-bit GUI version" -msgstr "" -"\n" -"Version graphique MS-Windows 16/32 bits" - msgid "" "\n" "MS-Windows 64-bit GUI version" @@ -6561,12 +6564,6 @@ msgstr "tapez :help registerSponsor/Register for information " msgstr "menu Aide->Sponsor/Enregistrement pour plus d'info" -msgid "WARNING: Windows 95/98/ME detected" -msgstr "ALERTE: Windows 95/98/ME détecté" - -msgid "type :help windows95 for info on this" -msgstr "tapez :help windows95 pour plus d'information" - msgid "Already only one window" msgstr "Il n'y a déjà plus qu'une fenêtre" @@ -6727,6 +6724,10 @@ msgstr "E236: La police \"%s\" n'a pas une chasse (largeur) fixe" msgid "E473: Internal error" msgstr "E473: Erreur interne" +#, c-format +msgid "E685: Internal error: %s" +msgstr "E685: Erreur interne : %s" + msgid "Interrupted" msgstr "Interrompu" @@ -7011,10 +7012,6 @@ msgid "E744: NetBeans does not allow changes in read-only files" msgstr "" "E744: NetBeans n'autorise pas la modification des fichiers en lecture seule" -#, c-format -msgid "E685: Internal error: %s" -msgstr "E685: Erreur interne : %s" - msgid "E363: pattern uses more memory than 'maxmempattern'" msgstr "E363: le motif utilise plus de mémoire que 'maxmempattern'" From de318c5c35ed0d65fd2a07196cb8acd5ee6d9bf8 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Tue, 17 Jan 2017 16:27:10 +0100 Subject: [PATCH 12/20] patch 8.0.0198: some syntax arguments take effect even after "if 0" Problem: Some syntax arguments take effect even after "if 0". (Taylor Venable) Solution: Properly skip the syntax statements. Make "syn case" and "syn conceal" report the current state. Fix that "syn clear" didn't reset the conceal flag. Add tests for :syntax skipping properly. --- src/syntax.c | 70 ++++++++++++++----- src/testdir/test_syntax.vim | 131 ++++++++++++++++++++++++++++++++++++ src/version.c | 2 + 3 files changed, 185 insertions(+), 18 deletions(-) diff --git a/src/syntax.c b/src/syntax.c index bc5c9b74ff..aed7ee6924 100644 --- a/src/syntax.c +++ b/src/syntax.c @@ -462,7 +462,7 @@ static void syn_clear_keyword(int id, hashtab_T *ht); static void clear_keywtab(hashtab_T *ht); static void add_keyword(char_u *name, int id, int flags, short *cont_in_list, short *next_list, int conceal_char); static char_u *get_group_name(char_u *arg, char_u **name_end); -static char_u *get_syn_options(char_u *arg, syn_opt_arg_T *opt, int *conceal_char); +static char_u *get_syn_options(char_u *arg, syn_opt_arg_T *opt, int *conceal_char, int skip); static void syn_cmd_include(exarg_T *eap, int syncing); static void syn_cmd_iskeyword(exarg_T *eap, int syncing); static void syn_cmd_keyword(exarg_T *eap, int syncing); @@ -481,7 +481,7 @@ static int syn_add_cluster(char_u *name); static void init_syn_patterns(void); static char_u *get_syn_pattern(char_u *arg, synpat_T *ci); static void syn_cmd_sync(exarg_T *eap, int syncing); -static int get_id_list(char_u **arg, int keylen, short **list); +static int get_id_list(char_u **arg, int keylen, short **list, int skip); static void syn_combine_list(short **clstr1, short **clstr2, int list_op); static void syn_incl_toplevel(int id, int *flagsp); @@ -3434,7 +3434,14 @@ syn_cmd_conceal(exarg_T *eap UNUSED, int syncing UNUSED) return; next = skiptowhite(arg); - if (STRNICMP(arg, "on", 2) == 0 && next - arg == 2) + if (*arg == NUL) + { + if (curwin->w_s->b_syn_conceal) + MSG(_("syn conceal on")); + else + MSG(_("syn conceal off")); + } + else if (STRNICMP(arg, "on", 2) == 0 && next - arg == 2) curwin->w_s->b_syn_conceal = TRUE; else if (STRNICMP(arg, "off", 3) == 0 && next - arg == 3) curwin->w_s->b_syn_conceal = FALSE; @@ -3457,7 +3464,14 @@ syn_cmd_case(exarg_T *eap, int syncing UNUSED) return; next = skiptowhite(arg); - if (STRNICMP(arg, "match", 5) == 0 && next - arg == 5) + if (*arg == NUL) + { + if (curwin->w_s->b_syn_ic) + MSG(_("syntax case ignore")); + else + MSG(_("syntax case match")); + } + else if (STRNICMP(arg, "match", 5) == 0 && next - arg == 5) curwin->w_s->b_syn_ic = FALSE; else if (STRNICMP(arg, "ignore", 6) == 0 && next - arg == 6) curwin->w_s->b_syn_ic = TRUE; @@ -3479,7 +3493,16 @@ syn_cmd_spell(exarg_T *eap, int syncing UNUSED) return; next = skiptowhite(arg); - if (STRNICMP(arg, "toplevel", 8) == 0 && next - arg == 8) + if (*arg == NUL) + { + if (curwin->w_s->b_syn_spell == SYNSPL_TOP) + MSG(_("syntax spell toplevel")); + else if (curwin->w_s->b_syn_spell == SYNSPL_NOTOP) + MSG(_("syntax spell notoplevel")); + else + MSG(_("syntax spell default")); + } + else if (STRNICMP(arg, "toplevel", 8) == 0 && next - arg == 8) curwin->w_s->b_syn_spell = SYNSPL_TOP; else if (STRNICMP(arg, "notoplevel", 10) == 0 && next - arg == 10) curwin->w_s->b_syn_spell = SYNSPL_NOTOP; @@ -3556,6 +3579,9 @@ syntax_clear(synblock_T *block) block->b_syn_ic = FALSE; /* Use case, by default */ block->b_syn_spell = SYNSPL_DEFAULT; /* default spell checking */ block->b_syn_containedin = FALSE; +#ifdef FEAT_CONCEAL + block->b_syn_conceal = FALSE; +#endif /* free the keywords */ clear_keywtab(&block->b_keywtab); @@ -4543,7 +4569,8 @@ get_group_name( get_syn_options( char_u *arg, /* next argument to be checked */ syn_opt_arg_T *opt, /* various things */ - int *conceal_char UNUSED) + int *conceal_char UNUSED, + int skip) /* TRUE if skipping over command */ { char_u *gname_start, *gname; int syn_id; @@ -4626,17 +4653,17 @@ get_syn_options( EMSG(_("E395: contains argument not accepted here")); return NULL; } - if (get_id_list(&arg, 8, &opt->cont_list) == FAIL) + if (get_id_list(&arg, 8, &opt->cont_list, skip) == FAIL) return NULL; } else if (flagtab[fidx].argtype == 2) { - if (get_id_list(&arg, 11, &opt->cont_in_list) == FAIL) + if (get_id_list(&arg, 11, &opt->cont_in_list, skip) == FAIL) return NULL; } else if (flagtab[fidx].argtype == 3) { - if (get_id_list(&arg, 9, &opt->next_list) == FAIL) + if (get_id_list(&arg, 9, &opt->next_list, skip) == FAIL) return NULL; } else if (flagtab[fidx].argtype == 11 && arg[5] == '=') @@ -4846,7 +4873,10 @@ syn_cmd_keyword(exarg_T *eap, int syncing UNUSED) if (rest != NULL) { - syn_id = syn_check_group(arg, (int)(group_name_end - arg)); + if (eap->skip) + syn_id = -1; + else + syn_id = syn_check_group(arg, (int)(group_name_end - arg)); if (syn_id != 0) /* allocate a buffer, for removing backslashes in the keyword */ keyword_copy = alloc((unsigned)STRLEN(rest) + 1); @@ -4868,7 +4898,8 @@ syn_cmd_keyword(exarg_T *eap, int syncing UNUSED) p = keyword_copy; for ( ; rest != NULL && !ends_excmd(*rest); rest = skipwhite(rest)) { - rest = get_syn_options(rest, &syn_opt_arg, &conceal_char); + rest = get_syn_options(rest, &syn_opt_arg, &conceal_char, + eap->skip); if (rest == NULL || ends_excmd(*rest)) break; /* Copy the keyword, removing backslashes, and add a NUL. */ @@ -4981,7 +5012,7 @@ syn_cmd_match( syn_opt_arg.cont_list = NULL; syn_opt_arg.cont_in_list = NULL; syn_opt_arg.next_list = NULL; - rest = get_syn_options(rest, &syn_opt_arg, &conceal_char); + rest = get_syn_options(rest, &syn_opt_arg, &conceal_char, eap->skip); /* get the pattern. */ init_syn_patterns(); @@ -4991,7 +5022,7 @@ syn_cmd_match( syn_opt_arg.flags |= HL_HAS_EOL; /* Get options after the pattern */ - rest = get_syn_options(rest, &syn_opt_arg, &conceal_char); + rest = get_syn_options(rest, &syn_opt_arg, &conceal_char, eap->skip); if (rest != NULL) /* all arguments are valid */ { @@ -5117,7 +5148,7 @@ syn_cmd_region( while (rest != NULL && !ends_excmd(*rest)) { /* Check for option arguments */ - rest = get_syn_options(rest, &syn_opt_arg, &conceal_char); + rest = get_syn_options(rest, &syn_opt_arg, &conceal_char, eap->skip); if (rest == NULL || ends_excmd(*rest)) break; @@ -5628,12 +5659,13 @@ syn_cmd_cluster(exarg_T *eap, int syncing UNUSED) break; clstr_list = NULL; - if (get_id_list(&rest, opt_len, &clstr_list) == FAIL) + if (get_id_list(&rest, opt_len, &clstr_list, eap->skip) == FAIL) { EMSG2(_(e_invarg2), rest); break; } - syn_combine_list(&SYN_CLSTR(curwin->w_s)[scl_id].scl_list, + if (scl_id >= 0) + syn_combine_list(&SYN_CLSTR(curwin->w_s)[scl_id].scl_list, &clstr_list, list_op); got_clstr = TRUE; } @@ -5931,8 +5963,9 @@ syn_cmd_sync(exarg_T *eap, int syncing UNUSED) get_id_list( char_u **arg, int keylen, /* length of keyword */ - short **list) /* where to store the resulting list, if not + short **list, /* where to store the resulting list, if not NULL, the list is silently skipped! */ + int skip) { char_u *p = NULL; char_u *end; @@ -6015,7 +6048,8 @@ get_id_list( } else if (name[1] == '@') { - id = syn_check_cluster(name + 2, (int)(end - p - 1)); + if (!skip) + id = syn_check_cluster(name + 2, (int)(end - p - 1)); } else { diff --git a/src/testdir/test_syntax.vim b/src/testdir/test_syntax.vim index 23ef1549e7..43155d6b77 100644 --- a/src/testdir/test_syntax.vim +++ b/src/testdir/test_syntax.vim @@ -162,3 +162,134 @@ func Test_syntax_completion() call feedkeys(":syn match \\\"\", 'tx') call assert_match('^"syn match Boolean Character ', @:) endfunc + +func Test_syntax_arg_skipped() + syn clear + syntax case ignore + if 0 + syntax case match + endif + call assert_match('case ignore', execute('syntax case')) + + syn keyword Foo foo + call assert_match('Foo', execute('syntax')) + syn clear + call assert_match('case match', execute('syntax case')) + call assert_notmatch('Foo', execute('syntax')) + + if has('conceal') + syn clear + syntax conceal on + if 0 + syntax conceal off + endif + call assert_match('conceal on', execute('syntax conceal')) + syn clear + call assert_match('conceal off', execute('syntax conceal')) + endif + + syntax region Tar start=// + if 0 + syntax region NotTest start=// contains=@Spell + endif + call assert_match('Tar', execute('syntax')) + call assert_notmatch('NotTest', execute('syntax')) + call assert_notmatch('Spell', execute('syntax')) + + hi Foo ctermfg=blue + let a = execute('hi Foo') + if 0 + syntax rest + endif + call assert_equal(a, execute('hi Foo')) + + set ft=tags + syn off + if 0 + syntax enable + endif + call assert_match('No Syntax items defined', execute('syntax')) + syntax enable + call assert_match('tagComment', execute('syntax')) + set ft= + + syn clear + if 0 + syntax include @Spell nothing + endif + call assert_notmatch('Spell', execute('syntax')) + + syn clear + syn iskeyword 48-57,$,_ + call assert_match('48-57,$,_', execute('syntax iskeyword')) + if 0 + syn clear + syn iskeyword clear + endif + call assert_match('48-57,$,_', execute('syntax iskeyword')) + syn iskeyword clear + call assert_match('not set', execute('syntax iskeyword')) + syn iskeyword 48-57,$,_ + syn clear + call assert_match('not set', execute('syntax iskeyword')) + + syn clear + syn keyword Foo foo + if 0 + syn keyword NotAdded bar + endif + call assert_match('Foo', execute('syntax')) + call assert_notmatch('NotAdded', execute('highlight')) + + syn clear + syn keyword Foo foo + call assert_match('Foo', execute('syntax')) + call assert_match('Foo', execute('syntax list')) + call assert_notmatch('Foo', execute('if 0 | syntax | endif')) + call assert_notmatch('Foo', execute('if 0 | syntax list | endif')) + + syn clear + syn match Fopi /asdf/ + if 0 + syn match Fopx /asdf/ + endif + call assert_match('Fopi', execute('syntax')) + call assert_notmatch('Fopx', execute('syntax')) + + syn clear + syn spell toplevel + call assert_match('spell toplevel', execute('syntax spell')) + if 0 + syn spell notoplevel + endif + call assert_match('spell toplevel', execute('syntax spell')) + syn spell notoplevel + call assert_match('spell notoplevel', execute('syntax spell')) + syn spell default + call assert_match('spell default', execute('syntax spell')) + + syn clear + if 0 + syntax cluster Spell + endif + call assert_notmatch('Spell', execute('syntax')) + + syn clear + syn keyword Foo foo + syn sync ccomment + syn sync maxlines=5 + if 0 + syn sync maxlines=11 + endif + call assert_match('on C-style comments', execute('syntax sync')) + call assert_match('maximal 5 lines', execute('syntax sync')) + syn clear + syn keyword Foo foo + if 0 + syn sync ccomment + endif + call assert_notmatch('on C-style comments', execute('syntax sync')) + + syn clear +endfunc + diff --git a/src/version.c b/src/version.c index 71c04506f5..d826cb31f3 100644 --- a/src/version.c +++ b/src/version.c @@ -764,6 +764,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 198, /**/ 197, /**/ From 6d721c7e10251ad8c89a461eed99d8cf2659c1df Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Tue, 17 Jan 2017 16:56:28 +0100 Subject: [PATCH 13/20] patch 8.0.0199: compiler warnings for libcall Problem: Warning for an unused parameter when the libcall feature is disabled. Warning for a function type cast when compiling with -pedantic. Solution: Add UNUSED. Use a different type cast. (Damien Molinier) --- src/evalfunc.c | 4 +--- src/os_unix.c | 4 ++-- src/version.c | 2 ++ 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/evalfunc.c b/src/evalfunc.c index 768a0f1574..4b6bfaa137 100644 --- a/src/evalfunc.c +++ b/src/evalfunc.c @@ -6859,10 +6859,8 @@ f_len(typval_T *argvars, typval_T *rettv) } } -static void libcall_common(typval_T *argvars, typval_T *rettv, int type); - static void -libcall_common(typval_T *argvars, typval_T *rettv, int type) +libcall_common(typval_T *argvars UNUSED, typval_T *rettv, int type) { #ifdef FEAT_LIBCALL char_u *string_in; diff --git a/src/os_unix.c b/src/os_unix.c index aa3c3e506d..48359d31ea 100644 --- a/src/os_unix.c +++ b/src/os_unix.c @@ -6918,7 +6918,7 @@ mch_libcall( if (argstring != NULL) { # if defined(USE_DLOPEN) - ProcAdd = (STRPROCSTR)dlsym(hinstLib, (const char *)funcname); + *(void **)(&ProcAdd) = dlsym(hinstLib, (const char *)funcname); dlerr = (char *)dlerror(); # else if (shl_findsym(&hinstLib, (const char *)funcname, @@ -6940,7 +6940,7 @@ mch_libcall( else { # if defined(USE_DLOPEN) - ProcAddI = (INTPROCSTR)dlsym(hinstLib, (const char *)funcname); + *(void **)(&ProcAddI) = dlsym(hinstLib, (const char *)funcname); dlerr = (char *)dlerror(); # else if (shl_findsym(&hinstLib, (const char *)funcname, diff --git a/src/version.c b/src/version.c index d826cb31f3..50bcce0ba8 100644 --- a/src/version.c +++ b/src/version.c @@ -764,6 +764,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 199, /**/ 198, /**/ From 58f60ca2fcd2858faac84e386b3ccf5ced75084d Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Tue, 17 Jan 2017 17:19:00 +0100 Subject: [PATCH 14/20] patch 8.0.0200: some syntax arguments are not tested Problem: Some syntax arguments are not tested. Solution: Add more syntax command tests. --- src/testdir/test_syntax.vim | 34 ++++++++++++++++++++++++++++++++-- src/version.c | 2 ++ 2 files changed, 34 insertions(+), 2 deletions(-) diff --git a/src/testdir/test_syntax.vim b/src/testdir/test_syntax.vim index 43155d6b77..c93f8b76d5 100644 --- a/src/testdir/test_syntax.vim +++ b/src/testdir/test_syntax.vim @@ -186,6 +186,10 @@ func Test_syntax_arg_skipped() call assert_match('conceal on', execute('syntax conceal')) syn clear call assert_match('conceal off', execute('syntax conceal')) + + syntax conceal on + syntax conceal off + call assert_match('conceal off', execute('syntax conceal')) endif syntax region Tar start=// @@ -283,8 +287,7 @@ func Test_syntax_arg_skipped() endif call assert_match('on C-style comments', execute('syntax sync')) call assert_match('maximal 5 lines', execute('syntax sync')) - syn clear - syn keyword Foo foo + syn sync clear if 0 syn sync ccomment endif @@ -293,3 +296,30 @@ func Test_syntax_arg_skipped() syn clear endfunc +func Test_invalid_arg() + call assert_fails('syntax case asdf', 'E390:') + call assert_fails('syntax conceal asdf', 'E390:') + call assert_fails('syntax spell asdf', 'E390:') +endfunc + +func Test_syn_sync() + syntax region HereGroup start=/this/ end=/that/ + syntax sync match SyncHere grouphere HereGroup "pattern" + call assert_match('SyncHere', execute('syntax sync')) + syn sync clear + call assert_notmatch('SyncHere', execute('syntax sync')) + syn clear +endfunc + +func Test_syn_clear() + syntax keyword Foo foo + syntax keyword Tar tar + call assert_match('Foo', execute('syntax')) + call assert_match('Tar', execute('syntax')) + syn clear Foo + call assert_notmatch('Foo', execute('syntax')) + call assert_match('Tar', execute('syntax')) + syn clear Foo Tar + call assert_notmatch('Foo', execute('syntax')) + call assert_notmatch('Tar', execute('syntax')) +endfunc diff --git a/src/version.c b/src/version.c index 50bcce0ba8..1d7af3390e 100644 --- a/src/version.c +++ b/src/version.c @@ -764,6 +764,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 200, /**/ 199, /**/ From d61e8aaae57bd66279def479462bf11c22ec2f1c Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Tue, 17 Jan 2017 17:44:46 +0100 Subject: [PATCH 15/20] patch 8.0.0201: completion of highlight groups includes cleared names Problem: When completing a group name for a highlight or syntax command cleared groups are included. Solution: Skip groups that have been cleared. --- src/syntax.c | 13 ++++++++++++- src/testdir/test_syntax.vim | 28 ++++++++++++++++++++-------- src/version.c | 2 ++ 3 files changed, 34 insertions(+), 9 deletions(-) diff --git a/src/syntax.c b/src/syntax.c index aed7ee6924..68f01c13a1 100644 --- a/src/syntax.c +++ b/src/syntax.c @@ -22,6 +22,7 @@ struct hl_group { char_u *sg_name; /* highlight group name */ char_u *sg_name_u; /* uppercase of sg_name */ + int sg_cleared; /* "hi clear" was used */ /* for normal terminals */ int sg_term; /* "term=" highlighting attributes */ char_u *sg_start; /* terminal string for start highl */ @@ -7327,6 +7328,7 @@ do_highlight( #ifdef FEAT_EVAL HL_TABLE()[from_id - 1].sg_scriptID = current_SID; #endif + HL_TABLE()[from_id - 1].sg_cleared = FALSE; redraw_all_later(SOME_VALID); } } @@ -8034,6 +8036,7 @@ do_highlight( error = TRUE; break; } + HL_TABLE()[idx].sg_cleared = FALSE; /* * When highlighting has been given for a group, don't link it. @@ -8171,6 +8174,8 @@ hl_has_settings(int idx, int check_link) static void highlight_clear(int idx) { + HL_TABLE()[idx].sg_cleared = TRUE; + HL_TABLE()[idx].sg_term = 0; vim_free(HL_TABLE()[idx].sg_start); HL_TABLE()[idx].sg_start = NULL; @@ -9958,7 +9963,13 @@ get_highlight_name(expand_T *xp UNUSED, int idx) && include_link != 0) return (char_u *)"clear"; #endif - if (idx < 0 || idx >= highlight_ga.ga_len) + if (idx < 0) + return NULL; + /* Items are never removed from the table, skip the ones that were cleared. + */ + while (idx < highlight_ga.ga_len && HL_TABLE()[idx].sg_cleared) + ++idx; + if (idx >= highlight_ga.ga_len) return NULL; return HL_TABLE()[idx].sg_name; } diff --git a/src/testdir/test_syntax.vim b/src/testdir/test_syntax.vim index c93f8b76d5..232da75df7 100644 --- a/src/testdir/test_syntax.vim +++ b/src/testdir/test_syntax.vim @@ -156,6 +156,12 @@ func Test_syntax_completion() call feedkeys(":syn sync \\\"\", 'tx') call assert_equal('"syn sync ccomment clear fromstart linebreaks= linecont lines= match maxlines= minlines= region', @:) + " Check that clearing "Aap" avoids it showing up before Boolean. + hi Aap ctermfg=blue + call feedkeys(":syn list \\\"\", 'tx') + call assert_match('^"syn list Aap Boolean Character ', @:) + hi clear Aap + call feedkeys(":syn list \\\"\", 'tx') call assert_match('^"syn list Boolean Character ', @:) @@ -192,11 +198,11 @@ func Test_syntax_arg_skipped() call assert_match('conceal off', execute('syntax conceal')) endif - syntax region Tar start=// + syntax region Bar start=// if 0 syntax region NotTest start=// contains=@Spell endif - call assert_match('Tar', execute('syntax')) + call assert_match('Bar', execute('syntax')) call assert_notmatch('NotTest', execute('syntax')) call assert_notmatch('Spell', execute('syntax')) @@ -206,6 +212,8 @@ func Test_syntax_arg_skipped() syntax rest endif call assert_equal(a, execute('hi Foo')) + hi clear Bar + hi clear Foo set ft=tags syn off @@ -298,7 +306,9 @@ endfunc func Test_invalid_arg() call assert_fails('syntax case asdf', 'E390:') - call assert_fails('syntax conceal asdf', 'E390:') + if has('conceal') + call assert_fails('syntax conceal asdf', 'E390:') + endif call assert_fails('syntax spell asdf', 'E390:') endfunc @@ -313,13 +323,15 @@ endfunc func Test_syn_clear() syntax keyword Foo foo - syntax keyword Tar tar + syntax keyword Bar tar call assert_match('Foo', execute('syntax')) - call assert_match('Tar', execute('syntax')) + call assert_match('Bar', execute('syntax')) syn clear Foo call assert_notmatch('Foo', execute('syntax')) - call assert_match('Tar', execute('syntax')) - syn clear Foo Tar + call assert_match('Bar', execute('syntax')) + syn clear Foo Bar call assert_notmatch('Foo', execute('syntax')) - call assert_notmatch('Tar', execute('syntax')) + call assert_notmatch('Bar', execute('syntax')) + hi clear Foo + hi clear Bar endfunc diff --git a/src/version.c b/src/version.c index 1d7af3390e..8184b66e7c 100644 --- a/src/version.c +++ b/src/version.c @@ -764,6 +764,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 201, /**/ 200, /**/ From 4007ed4a5e8c34197078e9d5718bd1d4a429dd23 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Tue, 17 Jan 2017 18:14:54 +0100 Subject: [PATCH 16/20] patch 8.0.0202: no test for invalid syntax group name Problem: No test for invalid syntax group name. Solution: Add a test for group name error and warning. --- src/testdir/test_syntax.vim | 11 +++++++++++ src/version.c | 2 ++ 2 files changed, 13 insertions(+) diff --git a/src/testdir/test_syntax.vim b/src/testdir/test_syntax.vim index 232da75df7..8a00f992f2 100644 --- a/src/testdir/test_syntax.vim +++ b/src/testdir/test_syntax.vim @@ -335,3 +335,14 @@ func Test_syn_clear() hi clear Foo hi clear Bar endfunc + +func Test_invalid_name() + syn clear + syn keyword Nop yes + call assert_fails("syntax keyword Wr\x17ong bar", 'E669:') + syntax keyword @Wrong bar + call assert_match('W18:', execute('1messages')) + syn clear + hi clear Nop + hi clear @Wrong +endfunc diff --git a/src/version.c b/src/version.c index 8184b66e7c..4ef7f4f4c9 100644 --- a/src/version.c +++ b/src/version.c @@ -764,6 +764,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 202, /**/ 201, /**/ From 6e78e27b8aace2e4c2412bfc4de6567509258d28 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Tue, 17 Jan 2017 19:20:15 +0100 Subject: [PATCH 17/20] patch 8.0.0203: order of complication flags is sometimes wrong Problem: Order of complication flags is sometimes wrong. Solution: Put interface-specific flags before ALL_CFLAGS. (idea by Yousong Zhou, closes #1100) --- src/Makefile | 25 ++++++++++++++----------- src/version.c | 2 ++ 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/src/Makefile b/src/Makefile index 38ca4cd16e..1070b23f77 100644 --- a/src/Makefile +++ b/src/Makefile @@ -1877,7 +1877,9 @@ myself: # The normal command to compile a .c file to its .o file. -CCC = $(CC) -c -I$(srcdir) $(ALL_CFLAGS) +# Without or with ALL_CFLAGS. +CCC_NF = $(CC) -c -I$(srcdir) +CCC = $(CCC_NF) $(ALL_CFLAGS) # Link the target for normal use or debugging. @@ -2976,7 +2978,7 @@ objects/gui_gtk_f.o: gui_gtk_f.c $(CCC) -o $@ gui_gtk_f.c objects/gui_gtk_gresources.o: auto/gui_gtk_gresources.c - $(CCC) $(PERL_CFLAGS) -o $@ auto/gui_gtk_gresources.c + $(CCC_NF) $(PERL_CFLAGS) $(ALL_CFLAGS) -o $@ auto/gui_gtk_gresources.c objects/gui_gtk_x11.o: gui_gtk_x11.c $(CCC) -o $@ gui_gtk_x11.c @@ -3009,7 +3011,7 @@ objects/if_xcmdsrv.o: if_xcmdsrv.c $(CCC) -o $@ if_xcmdsrv.c objects/if_lua.o: if_lua.c - $(CCC) $(LUA_CFLAGS) -o $@ if_lua.c + $(CCC_NF) $(LUA_CFLAGS) $(ALL_CFLAGS) -o $@ if_lua.c objects/if_mzsch.o: if_mzsch.c $(MZSCHEME_EXTRA) $(CCC) -o $@ $(MZSCHEME_CFLAGS_EXTRA) if_mzsch.c @@ -3018,27 +3020,28 @@ mzscheme_base.c: $(MZSCHEME_MZC) --c-mods mzscheme_base.c ++lib scheme/base objects/if_perl.o: auto/if_perl.c - $(CCC) $(PERL_CFLAGS) -o $@ auto/if_perl.c + $(CCC_NF) $(PERL_CFLAGS) $(ALL_CFLAGS) -o $@ auto/if_perl.c objects/if_perlsfio.o: if_perlsfio.c - $(CCC) $(PERL_CFLAGS) -o $@ if_perlsfio.c + $(CCC_NF) $(PERL_CFLAGS) $(ALL_CFLAGS) -o $@ if_perlsfio.c objects/py_getpath.o: $(PYTHON_CONFDIR)/getpath.c - $(CCC) $(PYTHON_CFLAGS) -o $@ $(PYTHON_CONFDIR)/getpath.c \ + $(CCC_NF) $(PYTHON_CFLAGS) $(ALL_CFLAGS) -o $@ \ + $(PYTHON_CONFDIR)/getpath.c \ -I$(PYTHON_CONFDIR) -DHAVE_CONFIG_H -DNO_MAIN \ $(PYTHON_GETPATH_CFLAGS) objects/if_python.o: if_python.c if_py_both.h - $(CCC) $(PYTHON_CFLAGS) $(PYTHON_CFLAGS_EXTRA) -o $@ if_python.c + $(CCC_NF) $(PYTHON_CFLAGS) $(PYTHON_CFLAGS_EXTRA) $(ALL_CFLAGS) -o $@ if_python.c objects/if_python3.o: if_python3.c if_py_both.h - $(CCC) $(PYTHON3_CFLAGS) $(PYTHON3_CFLAGS_EXTRA) -o $@ if_python3.c + $(CCC_NF) $(PYTHON3_CFLAGS) $(PYTHON3_CFLAGS_EXTRA) $(ALL_CFLAGS) -o $@ if_python3.c objects/if_ruby.o: if_ruby.c - $(CCC) $(RUBY_CFLAGS) -o $@ if_ruby.c + $(CCC_NF) $(RUBY_CFLAGS) $(ALL_CFLAGS) -o $@ if_ruby.c objects/if_tcl.o: if_tcl.c - $(CCC) $(TCL_CFLAGS) -o $@ if_tcl.c + $(CCC_NF) $(TCL_CFLAGS) $(ALL_CFLAGS) -o $@ if_tcl.c objects/integration.o: integration.c $(CCC) -o $@ integration.c @@ -3095,7 +3098,7 @@ objects/ops.o: ops.c $(CCC) -o $@ ops.c objects/option.o: option.c - $(CCC) $(LUA_CFLAGS) $(PERL_CFLAGS) $(PYTHON_CFLAGS) $(PYTHON3_CFLAGS) $(RUBY_CFLAGS) $(TCL_CFLAGS) -o $@ option.c + $(CCC_NF) $(LUA_CFLAGS) $(PERL_CFLAGS) $(PYTHON_CFLAGS) $(PYTHON3_CFLAGS) $(RUBY_CFLAGS) $(TCL_CFLAGS) $(ALL_CFLAGS) -o $@ option.c objects/os_beos.o: os_beos.c $(CCC) -o $@ os_beos.c diff --git a/src/version.c b/src/version.c index 4ef7f4f4c9..263e4caa18 100644 --- a/src/version.c +++ b/src/version.c @@ -764,6 +764,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 203, /**/ 202, /**/ From eb46f8fa14a586779f55b1c7f1648f559618322e Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Tue, 17 Jan 2017 19:48:53 +0100 Subject: [PATCH 18/20] patch 8.0.0204: compiler warns for uninitialized variable Problem: Compiler warns for uninitialized variable. (Tony Mechelynck) Solution: When skipping set "id" to -1. --- src/syntax.c | 4 +++- src/version.c | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/syntax.c b/src/syntax.c index 68f01c13a1..e466de8985 100644 --- a/src/syntax.c +++ b/src/syntax.c @@ -6049,7 +6049,9 @@ get_id_list( } else if (name[1] == '@') { - if (!skip) + if (skip) + id = -1; + else id = syn_check_cluster(name + 2, (int)(end - p - 1)); } else diff --git a/src/version.c b/src/version.c index 263e4caa18..a99c17e7bd 100644 --- a/src/version.c +++ b/src/version.c @@ -764,6 +764,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 204, /**/ 203, /**/ From 5e4e1b12998b1ed99138cad1c5da4d430f798547 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Tue, 17 Jan 2017 22:09:45 +0100 Subject: [PATCH 19/20] patch 8.0.0205: wrong behavior after :undojoin Problem: After :undojoin some commands don't work properly, such as :redo. (Matthew Malcomson) Solution: Don't set curbuf->b_u_curhead. (closes #1390) --- src/testdir/test_undo.vim | 12 +++++++++++- src/undo.c | 7 ++----- src/version.c | 2 ++ 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/src/testdir/test_undo.vim b/src/testdir/test_undo.vim index f2ac6a8eab..06732af715 100644 --- a/src/testdir/test_undo.vim +++ b/src/testdir/test_undo.vim @@ -176,7 +176,17 @@ func Test_undojoin() call assert_equal(['aaaa', 'bbbb', 'cccc'], getline(2, '$')) call feedkeys("u", 'xt') call assert_equal(['aaaa'], getline(2, '$')) - close! + bwipe! +endfunc + +func Test_undojoin_redo() + new + call setline(1, ['first line', 'second line']) + call feedkeys("ixx\", 'xt') + call feedkeys(":undojoin | redo\", 'xt') + call assert_equal('xxfirst line', getline(1)) + call assert_equal('second line', getline(2)) + bwipe! endfunc func Test_undo_write() diff --git a/src/undo.c b/src/undo.c index 607f35fdd8..b69f318723 100644 --- a/src/undo.c +++ b/src/undo.c @@ -3136,11 +3136,8 @@ ex_undojoin(exarg_T *eap UNUSED) if (get_undolevel() < 0) return; /* no entries, nothing to do */ else - { - /* Go back to the last entry */ - curbuf->b_u_curhead = curbuf->b_u_newhead; - curbuf->b_u_synced = FALSE; /* no entries, nothing to do */ - } + /* Append next change to the last entry */ + curbuf->b_u_synced = FALSE; } /* diff --git a/src/version.c b/src/version.c index a99c17e7bd..766f9890c8 100644 --- a/src/version.c +++ b/src/version.c @@ -764,6 +764,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 205, /**/ 204, /**/ From 8822744b4d9d40aa1fd59870a8bdd7c64c59a42b Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Tue, 17 Jan 2017 22:16:00 +0100 Subject: [PATCH 20/20] patch 8.0.0206: test coverage for :retab insufficient Problem: Test coverage for :retab insufficient. Solution: Add test for :retab. (Dominique Pelle, closes #1391) --- src/Makefile | 1 + src/testdir/Make_all.mak | 1 + src/testdir/test_retab.vim | 77 ++++++++++++++++++++++++++++++++++++++ src/version.c | 2 + 4 files changed, 81 insertions(+) create mode 100644 src/testdir/test_retab.vim diff --git a/src/Makefile b/src/Makefile index 1070b23f77..0dcf109604 100644 --- a/src/Makefile +++ b/src/Makefile @@ -2154,6 +2154,7 @@ test_arglist \ test_regexp_latin \ test_regexp_utf8 \ test_reltime \ + test_retab \ test_ruby \ test_search \ test_searchpos \ diff --git a/src/testdir/Make_all.mak b/src/testdir/Make_all.mak index 5b9c5724c3..e0da1b408d 100644 --- a/src/testdir/Make_all.mak +++ b/src/testdir/Make_all.mak @@ -177,6 +177,7 @@ NEW_TESTS = test_arglist.res \ test_perl.res \ test_profile.res \ test_quickfix.res \ + test_retab.res \ test_ruby.res \ test_search.res \ test_signs.res \ diff --git a/src/testdir/test_retab.vim b/src/testdir/test_retab.vim new file mode 100644 index 0000000000..f11a32bade --- /dev/null +++ b/src/testdir/test_retab.vim @@ -0,0 +1,77 @@ +" Test :retab +func SetUp() + new + call setline(1, "\ta \t b c ") +endfunc + +func TearDown() + bwipe! +endfunc + +func Retab(bang, n) + let l:old_tabstop = &tabstop + let l:old_line = getline(1) + exe "retab" . a:bang . a:n + let l:line = getline(1) + call setline(1, l:old_line) + if a:n > 0 + " :retab changes 'tabstop' to n with argument n > 0. + call assert_equal(a:n, &tabstop) + exe 'set tabstop=' . l:old_tabstop + else + " :retab does not change 'tabstop' with empty or n <= 0. + call assert_equal(l:old_tabstop, &tabstop) + endif + return l:line +endfunc + +func Test_retab() + set tabstop=8 noexpandtab + call assert_equal("\ta\t b c ", Retab('', '')) + call assert_equal("\ta\t b c ", Retab('', 0)) + call assert_equal("\ta\t b c ", Retab('', 8)) + call assert_equal("\ta\t b\t c\t ", Retab('!', '')) + call assert_equal("\ta\t b\t c\t ", Retab('!', 0)) + call assert_equal("\ta\t b\t c\t ", Retab('!', 8)) + + call assert_equal("\t\ta\t\t\tb c ", Retab('', 4)) + call assert_equal("\t\ta\t\t\tb\t\t c\t ", Retab('!', 4)) + + call assert_equal(" a\t\tb c ", Retab('', 10)) + call assert_equal(" a\t\tb c ", Retab('!', 10)) + + set tabstop=8 expandtab + call assert_equal(" a b c ", Retab('', '')) + call assert_equal(" a b c ", Retab('', 0)) + call assert_equal(" a b c ", Retab('', 8)) + call assert_equal(" a b c ", Retab('!', '')) + call assert_equal(" a b c ", Retab('!', 0)) + call assert_equal(" a b c ", Retab('!', 8)) + + call assert_equal(" a b c ", Retab(' ', 4)) + call assert_equal(" a b c ", Retab('!', 4)) + + call assert_equal(" a b c ", Retab(' ', 10)) + call assert_equal(" a b c ", Retab('!', 10)) + + set tabstop=4 noexpandtab + call assert_equal("\ta\t\tb c ", Retab('', '')) + call assert_equal("\ta\t\tb\t\t c\t ", Retab('!', '')) + call assert_equal("\t a\t\t\tb c ", Retab('', 3)) + call assert_equal("\t a\t\t\tb\t\t\tc\t ", Retab('!', 3)) + call assert_equal(" a\t b c ", Retab('', 5)) + call assert_equal(" a\t b\t\t c\t ", Retab('!', 5)) + + set tabstop=4 expandtab + call assert_equal(" a b c ", Retab('', '')) + call assert_equal(" a b c ", Retab('!', '')) + call assert_equal(" a b c ", Retab('', 3)) + call assert_equal(" a b c ", Retab('!', 3)) + call assert_equal(" a b c ", Retab('', 5)) + call assert_equal(" a b c ", Retab('!', 5)) +endfunc + +func Test_retab_error() + call assert_fails('retab -1', 'E487:') + call assert_fails('retab! -1', 'E487:') +endfunc diff --git a/src/version.c b/src/version.c index 766f9890c8..f3c4a4bf5e 100644 --- a/src/version.c +++ b/src/version.c @@ -764,6 +764,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 206, /**/ 205, /**/