From 4a96bd0f331635be5507aee88d1d01d3556cbe19 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Thu, 5 Sep 2013 12:06:33 +0200 Subject: [PATCH 01/12] updated for version 7.4.017 Problem: ":help !!" does not find the "!!" tag in the help file. (Ben Fritz) Solution: When reading the start of the tags file do parse lines that are not header lines. --- src/tag.c | 12 ++++++++---- src/version.c | 2 ++ 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/tag.c b/src/tag.c index 8a3c81c817..55ace15bff 100644 --- a/src/tag.c +++ b/src/tag.c @@ -1797,13 +1797,16 @@ line_read_in: */ if (state == TS_START) { - /* The header ends when the line sorts below "!_TAG_". - * There may be non-header items before the header though, - * e.g. "!" itself. When case is folded lower case letters - * sort before "_". */ + /* The header ends when the line sorts below "!_TAG_". When + * case is folded lower case letters sort before "_". */ if (STRNCMP(lbuf, "!_TAG_", 6) <= 0 || (lbuf[0] == '!' && ASCII_ISLOWER(lbuf[1]))) { + if (STRNCMP(lbuf, "!_TAG_", 6) != 0) + /* Non-header item before the header, e.g. "!" itself. + */ + goto parse_line; + /* * Read header line. */ @@ -1898,6 +1901,7 @@ line_read_in: #endif } +parse_line: /* * Figure out where the different strings are in this line. * For "normal" tags: Do a quick check if the tag matches. diff --git a/src/version.c b/src/version.c index ce71dff777..97657b6e51 100644 --- a/src/version.c +++ b/src/version.c @@ -738,6 +738,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 17, /**/ 16, /**/ From 2a951b715697ae456f6cd7e601abd4129c5874c4 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Thu, 5 Sep 2013 12:06:33 +0200 Subject: [PATCH 02/12] Added tag v7-4-017 for changeset c47c8cd5fe5c --- .hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/.hgtags b/.hgtags index d112ae08aa..3c9ac76f09 100644 --- a/.hgtags +++ b/.hgtags @@ -2739,3 +2739,4 @@ bb358cc41d920983629ace62bcf26decbf06cab4 v7-4-010 9801d06e7b4ccdcd02cf40bee34eaaada0ca0409 v7-4-014 a7478f9f2551e95bff138cd658f7a86ced804ab1 v7-4-015 8d5cd0ec3e7183a289f9bac41d3981307cdc1fac v7-4-016 +c47c8cd5fe5c014c141d9fb3fa8935b268436a4e v7-4-017 From 777ae8ac4738fd1f51b2c36973de51f1dcc8021f Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Thu, 5 Sep 2013 12:49:52 +0200 Subject: [PATCH 03/12] updated for version 7.4.018 Problem: When completing item becomes unselected. (Shougo Matsu) Solution: Revert patch 7.3.1269. --- src/edit.c | 1 - src/version.c | 2 ++ 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/edit.c b/src/edit.c index b76ebe5c10..6f8dc49a3d 100644 --- a/src/edit.c +++ b/src/edit.c @@ -3467,7 +3467,6 @@ ins_compl_new_leader() } compl_enter_selects = !compl_used_match; - compl_shown_match = compl_curr_match = compl_first_match; /* Show the popup menu with a different set of matches. */ ins_compl_show_pum(); diff --git a/src/version.c b/src/version.c index 97657b6e51..abed945407 100644 --- a/src/version.c +++ b/src/version.c @@ -738,6 +738,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 18, /**/ 17, /**/ From 9297019ba6d331e73304f27127dc18a82ab4bd26 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Thu, 5 Sep 2013 12:49:52 +0200 Subject: [PATCH 04/12] Added tag v7-4-018 for changeset 460d5be9395e --- .hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/.hgtags b/.hgtags index 3c9ac76f09..79a62228cf 100644 --- a/.hgtags +++ b/.hgtags @@ -2740,3 +2740,4 @@ bb358cc41d920983629ace62bcf26decbf06cab4 v7-4-010 a7478f9f2551e95bff138cd658f7a86ced804ab1 v7-4-015 8d5cd0ec3e7183a289f9bac41d3981307cdc1fac v7-4-016 c47c8cd5fe5c014c141d9fb3fa8935b268436a4e v7-4-017 +460d5be9395ef3e05f4b1397ea98a5b54d825fc5 v7-4-018 From 8e2a162bf874faf7ec850c75067ecfb17038d7e9 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Thu, 5 Sep 2013 13:50:53 +0200 Subject: [PATCH 05/12] updated for version 7.4.019 Problem: MS-Windows: File name completion doesn't work properly with Chinese characters. (Yue Wu) Solution: Take care of multi-byte characters when looking for the start of the file name. (Ken Takata) --- src/edit.c | 10 ++++++++-- src/version.c | 2 ++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/edit.c b/src/edit.c index 6f8dc49a3d..0c6089b683 100644 --- a/src/edit.c +++ b/src/edit.c @@ -5183,8 +5183,14 @@ ins_complete(c) } else if (ctrl_x_mode == CTRL_X_FILES) { - while (--startcol >= 0 && vim_isfilec(line[startcol])) - ; + char_u *p = line + startcol; + + /* Go back to just before the first filename character. */ + mb_ptr_back(line, p); + while (vim_isfilec(PTR2CHAR(p)) && p >= line) + mb_ptr_back(line, p); + startcol = p - line; + compl_col += ++startcol; compl_length = (int)curs_col - startcol; compl_pattern = addstar(line + compl_col, compl_length, diff --git a/src/version.c b/src/version.c index abed945407..0e6dc1c807 100644 --- a/src/version.c +++ b/src/version.c @@ -738,6 +738,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 19, /**/ 18, /**/ From 1af6c83e0a5781bd280b19f69e8f3320fc14279a Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Thu, 5 Sep 2013 13:50:53 +0200 Subject: [PATCH 06/12] Added tag v7-4-019 for changeset d5eb32dc231c --- .hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/.hgtags b/.hgtags index 79a62228cf..a5d540d436 100644 --- a/.hgtags +++ b/.hgtags @@ -2741,3 +2741,4 @@ a7478f9f2551e95bff138cd658f7a86ced804ab1 v7-4-015 8d5cd0ec3e7183a289f9bac41d3981307cdc1fac v7-4-016 c47c8cd5fe5c014c141d9fb3fa8935b268436a4e v7-4-017 460d5be9395ef3e05f4b1397ea98a5b54d825fc5 v7-4-018 +d5eb32dc231cd870c562e7b0be96fa994b505d9f v7-4-019 From 4fafaa8b36a0b1be2575b3d57709a0dc6a1094d3 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Thu, 5 Sep 2013 16:05:36 +0200 Subject: [PATCH 07/12] updated for version 7.4.020 Problem: NFA engine matches too much with \@>. (John McGowan) Solution: When a whole pattern match is found stop searching. --- src/regexp_nfa.c | 5 ++++- src/testdir/test64.in | 1 + src/testdir/test64.ok | 3 +++ src/version.c | 2 ++ 4 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/regexp_nfa.c b/src/regexp_nfa.c index 5288eb6d3f..fe1d025829 100644 --- a/src/regexp_nfa.c +++ b/src/regexp_nfa.c @@ -5322,7 +5322,10 @@ nfa_regmatch(prog, start, submatch, m) log_subsexpr(m); #endif nfa_match = TRUE; - break; + /* See comment above at "goto nextchar". */ + if (nextlist->n == 0) + clen = 0; + goto nextchar; case NFA_START_INVISIBLE: case NFA_START_INVISIBLE_FIRST: diff --git a/src/testdir/test64.in b/src/testdir/test64.in index ac3f13d543..8f7008c1a1 100644 --- a/src/testdir/test64.in +++ b/src/testdir/test64.in @@ -427,6 +427,7 @@ STARTTEST :""""" \@> :call add(tl, [2, '\(a*\)\@>a', 'aaaa']) :call add(tl, [2, '\(a*\)\@>b', 'aaab', 'aaab', 'aaa']) +:call add(tl, [2, '^\(.\{-}b\)\@>.', ' abcbd', ' abc', ' ab']) :" TODO: BT engine does not restore submatch after failure :call add(tl, [1, '\(a*\)\@>a\|a\+', 'aaaa', 'aaaa']) :" diff --git a/src/testdir/test64.ok b/src/testdir/test64.ok index da19c04237..fa83f91afa 100644 --- a/src/testdir/test64.ok +++ b/src/testdir/test64.ok @@ -983,6 +983,9 @@ OK 2 - \(a*\)\@>a OK 0 - \(a*\)\@>b OK 1 - \(a*\)\@>b OK 2 - \(a*\)\@>b +OK 0 - ^\(.\{-}b\)\@>. +OK 1 - ^\(.\{-}b\)\@>. +OK 2 - ^\(.\{-}b\)\@>. OK 0 - \(a*\)\@>a\|a\+ OK 2 - \(a*\)\@>a\|a\+ OK 0 - \_[^8-9]\+ diff --git a/src/version.c b/src/version.c index 0e6dc1c807..99c9d222df 100644 --- a/src/version.c +++ b/src/version.c @@ -738,6 +738,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 20, /**/ 19, /**/ From e14e2bd1fe09d1e9eb3d1e1a9c691a5d5919ebb8 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Thu, 5 Sep 2013 16:05:36 +0200 Subject: [PATCH 08/12] Added tag v7-4-020 for changeset c1ae5baa41f4 --- .hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/.hgtags b/.hgtags index a5d540d436..ad7dc6bd25 100644 --- a/.hgtags +++ b/.hgtags @@ -2742,3 +2742,4 @@ a7478f9f2551e95bff138cd658f7a86ced804ab1 v7-4-015 c47c8cd5fe5c014c141d9fb3fa8935b268436a4e v7-4-017 460d5be9395ef3e05f4b1397ea98a5b54d825fc5 v7-4-018 d5eb32dc231cd870c562e7b0be96fa994b505d9f v7-4-019 +c1ae5baa41f47bbf96be81e0158707a88af48b34 v7-4-020 From ac58a6bcd4645b0e538fa253ff545c6c4dced37a Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Thu, 5 Sep 2013 21:15:44 +0200 Subject: [PATCH 09/12] updated for version 7.4.021 Problem: NFA regexp: Using \ze in one branch which doesn't match may cause end of another branch to be wrong. (William Fugh) Solution: Set end position if it wasn't set yet. --- src/regexp_nfa.c | 7 ++++--- src/testdir/test64.in | 1 + src/testdir/test64.ok | 3 +++ src/version.c | 2 ++ 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/regexp_nfa.c b/src/regexp_nfa.c index fe1d025829..30aae8dcce 100644 --- a/src/regexp_nfa.c +++ b/src/regexp_nfa.c @@ -4209,10 +4209,11 @@ skip_add: break; case NFA_MCLOSE: - if (nfa_has_zend) + if (nfa_has_zend && (REG_MULTI + ? subs->norm.list.multi[0].end.lnum >= 0 + : subs->norm.list.line[0].end != NULL)) { - /* Do not overwrite the position set by \ze. If no \ze - * encountered end will be set in nfa_regtry(). */ + /* Do not overwrite the position set by \ze. */ subs = addstate(l, state->out, subs, pim, off); break; } diff --git a/src/testdir/test64.in b/src/testdir/test64.in index 8f7008c1a1..e694995cfd 100644 --- a/src/testdir/test64.in +++ b/src/testdir/test64.in @@ -328,6 +328,7 @@ STARTTEST :call add(tl, [2, 'abc \zsmatch\ze abc', 'abc abc abc match abc abc', 'match']) :call add(tl, [2, '\v(a \zsif .*){2}', 'a if then a if last', 'if last', 'a if last']) :call add(tl, [2, '\>\zs.', 'aword. ', '.']) +:call add(tl, [2, '\s\+\ze\[/\|\s\zs\s\+', 'is [a t', ' ']) :" :"""" Tests for \@= and \& features :call add(tl, [2, 'abc\@=', 'abc', 'ab']) diff --git a/src/testdir/test64.ok b/src/testdir/test64.ok index fa83f91afa..3d117b9957 100644 --- a/src/testdir/test64.ok +++ b/src/testdir/test64.ok @@ -752,6 +752,9 @@ OK 2 - \v(a \zsif .*){2} OK 0 - \>\zs. OK 1 - \>\zs. OK 2 - \>\zs. +OK 0 - \s\+\ze\[/\|\s\zs\s\+ +OK 1 - \s\+\ze\[/\|\s\zs\s\+ +OK 2 - \s\+\ze\[/\|\s\zs\s\+ OK 0 - abc\@= OK 1 - abc\@= OK 2 - abc\@= diff --git a/src/version.c b/src/version.c index 99c9d222df..06bcaa3e41 100644 --- a/src/version.c +++ b/src/version.c @@ -738,6 +738,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 21, /**/ 20, /**/ From c33239dbbb6b1ae5bdc284fef6ebef291d040f2f Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Thu, 5 Sep 2013 21:15:44 +0200 Subject: [PATCH 10/12] Added tag v7-4-021 for changeset c514693882b9 --- .hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/.hgtags b/.hgtags index ad7dc6bd25..836678a660 100644 --- a/.hgtags +++ b/.hgtags @@ -2743,3 +2743,4 @@ c47c8cd5fe5c014c141d9fb3fa8935b268436a4e v7-4-017 460d5be9395ef3e05f4b1397ea98a5b54d825fc5 v7-4-018 d5eb32dc231cd870c562e7b0be96fa994b505d9f v7-4-019 c1ae5baa41f47bbf96be81e0158707a88af48b34 v7-4-020 +c514693882b9f1c7be2e76a0307926df799da3ea v7-4-021 From 842c4dd4475f6fa05cc803cd8c37d005da7a18fd Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Thu, 5 Sep 2013 21:41:39 +0200 Subject: [PATCH 11/12] updated for version 7.4.022 Problem: Deadlock while exiting, because of allocating memory. Solution: Do not use gettext() in deathtrap(). (James McCoy) --- src/misc1.c | 6 ++++-- src/os_unix.c | 17 ++++++++++++----- src/version.c | 2 ++ 3 files changed, 18 insertions(+), 7 deletions(-) diff --git a/src/misc1.c b/src/misc1.c index fd5d1fda88..0a2d83be03 100644 --- a/src/misc1.c +++ b/src/misc1.c @@ -9174,6 +9174,8 @@ prepare_to_exit() /* * Preserve files and exit. * When called IObuff must contain a message. + * NOTE: This may be called from deathtrap() in a signal handler, avoid unsafe + * functions, such as allocating memory. */ void preserve_exit() @@ -9196,7 +9198,7 @@ preserve_exit() { if (buf->b_ml.ml_mfp != NULL && buf->b_ml.ml_mfp->mf_fname != NULL) { - OUT_STR(_("Vim: preserving files...\n")); + OUT_STR("Vim: preserving files...\n"); screen_start(); /* don't know where cursor is now */ out_flush(); ml_sync_all(FALSE, FALSE); /* preserve all swap files */ @@ -9206,7 +9208,7 @@ preserve_exit() ml_close_all(FALSE); /* close all memfiles, without deleting */ - OUT_STR(_("Vim: Finished.\n")); + OUT_STR("Vim: Finished.\n"); getout(1); } diff --git a/src/os_unix.c b/src/os_unix.c index 37cc3a7dd2..cc026534d3 100644 --- a/src/os_unix.c +++ b/src/os_unix.c @@ -957,8 +957,10 @@ mch_didjmp() /* * This function handles deadly signals. - * It tries to preserve any swap file and exit properly. + * It tries to preserve any swap files and exit properly. * (partly from Elvis). + * NOTE: Avoid unsafe functions, such as allocating memory, they can result in + * a deadlock. */ static RETSIGTYPE deathtrap SIGDEFARG(sigarg) @@ -1090,18 +1092,23 @@ deathtrap SIGDEFARG(sigarg) } if (entered == 2) { - OUT_STR(_("Vim: Double signal, exiting\n")); + /* No translation, it may call malloc(). */ + OUT_STR("Vim: Double signal, exiting\n"); out_flush(); getout(1); } + /* No translation, it may call malloc(). */ #ifdef SIGHASARG - sprintf((char *)IObuff, _("Vim: Caught deadly signal %s\n"), + sprintf((char *)IObuff, "Vim: Caught deadly signal %s\n", signal_info[i].name); #else - sprintf((char *)IObuff, _("Vim: Caught deadly signal\n")); + sprintf((char *)IObuff, "Vim: Caught deadly signal\n"); #endif - preserve_exit(); /* preserve files and exit */ + + /* Preserve files and exit. This sets the really_exiting flag to prevent + * calling free(). */ + preserve_exit(); #ifdef NBDEBUG reset_signals(); diff --git a/src/version.c b/src/version.c index 06bcaa3e41..5b37f047da 100644 --- a/src/version.c +++ b/src/version.c @@ -738,6 +738,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 22, /**/ 21, /**/ From 25bd5e53f47bb02481a2618c66fe7352a189eb00 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Thu, 5 Sep 2013 21:41:40 +0200 Subject: [PATCH 12/12] Added tag v7-4-022 for changeset 965044860b7f --- .hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/.hgtags b/.hgtags index 836678a660..1a58e038f9 100644 --- a/.hgtags +++ b/.hgtags @@ -2744,3 +2744,4 @@ c47c8cd5fe5c014c141d9fb3fa8935b268436a4e v7-4-017 d5eb32dc231cd870c562e7b0be96fa994b505d9f v7-4-019 c1ae5baa41f47bbf96be81e0158707a88af48b34 v7-4-020 c514693882b9f1c7be2e76a0307926df799da3ea v7-4-021 +965044860b7f4884657fcaa042853238c7b13e69 v7-4-022