From a693d0584b9a7ccce98813dda3a6badb209904c7 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Thu, 29 Jun 2017 22:23:06 +0200 Subject: [PATCH 1/3] patch 8.0.0689: ~ character not escaped when extending search pattern Problem: The ~ character is not escaped when adding to the search pattern with CTRL-L. (Ramel Eshed) Solution: Escape the character. (Christian Brabandt) --- src/ex_getln.c | 2 +- src/testdir/test_search.vim | 20 ++++++++++++++++++++ src/version.c | 2 ++ 3 files changed, 23 insertions(+), 1 deletion(-) diff --git a/src/ex_getln.c b/src/ex_getln.c index ba8fde65e9..11de136bf7 100644 --- a/src/ex_getln.c +++ b/src/ex_getln.c @@ -1492,7 +1492,7 @@ getcmdline( if (c != NUL) { if (c == firstc || vim_strchr((char_u *)( - p_magic ? "\\^$.*[" : "\\^$"), c) + p_magic ? "\\~^$.*[" : "\\^$"), c) != NULL) { /* put a backslash before special diff --git a/src/testdir/test_search.vim b/src/testdir/test_search.vim index 730e683911..18a4577b7f 100644 --- a/src/testdir/test_search.vim +++ b/src/testdir/test_search.vim @@ -302,3 +302,23 @@ func Test_searchc() exe "norm 0t\u93cf" bw! endfunc + +func Test_search_cmdline3() + if !exists('+incsearch') + return + endif + " need to disable char_avail, + " so that expansion of commandline works + call test_override("char_avail", 1) + new + call setline(1, [' 1', ' 2 the~e', ' 3 the theother']) + set incsearch + 1 + " first match + call feedkeys("/the\\", 'tx') + call assert_equal(' 2 the~e', getline('.')) + " clean up + set noincsearch + call test_override("char_avail", 0) + bw! +endfunc diff --git a/src/version.c b/src/version.c index 7bf3f4e9c6..64f035dbd9 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 */ +/**/ + 689, /**/ 688, /**/ From c2226845eb207bcd1a24e1afa941acbfecbc5170 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Thu, 29 Jun 2017 22:27:24 +0200 Subject: [PATCH 2/3] patch 8.0.0690: compiler warning on non-Unix system Problem: Compiler warning on non-Unix system. Solution: Add #ifdef. (John Marriott) --- src/term.c | 8 +++++--- src/version.c | 2 ++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/term.c b/src/term.c index 0dbe6d500b..989d6b7af6 100644 --- a/src/term.c +++ b/src/term.c @@ -2524,7 +2524,9 @@ out_str_cf(char_u *s) { if (s != NULL && *s) { +#ifdef HAVE_TGETENT char_u *p; +#endif #ifdef FEAT_GUI /* Don't use tputs() when GUI is used, ncurses crashes. */ @@ -2549,7 +2551,7 @@ out_str_cf(char_u *s) tputs((char *)p, 1, TPUTSFUNCAST out_char_nf); *s = save_c; out_flush(); -#ifdef ELAPSED_FUNC +# ifdef ELAPSED_FUNC /* Only sleep here if we can limit this happening in * vim_beep(). */ p = vim_strchr(s, '>'); @@ -2563,10 +2565,10 @@ out_str_cf(char_u *s) ++p; do_sleep(duration); } -#else +# else /* Rely on the terminal library to sleep. */ p = s; -#endif +# endif break; } } diff --git a/src/version.c b/src/version.c index 64f035dbd9..27f04365e4 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 */ +/**/ + 690, /**/ 689, /**/ From a83fe75ca76f6f74daa1e5a620054b973b43379b Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Thu, 29 Jun 2017 22:33:13 +0200 Subject: [PATCH 3/3] patch 8.0.0691: compiler warning without the linebreak feature Problem: Compiler warning without the linebreak feature. Solution: Add #ifdef. (John Marriott) --- src/edit.c | 2 ++ src/version.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/edit.c b/src/edit.c index 912f05f389..e08370863c 100644 --- a/src/edit.c +++ b/src/edit.c @@ -7329,7 +7329,9 @@ oneleft(void) #ifdef FEAT_VIRTUALEDIT if (virtual_active()) { +# ifdef FEAT_LINEBREAK int width; +# endif int v = getviscol(); if (v == 0) diff --git a/src/version.c b/src/version.c index 27f04365e4..4e7558a4b4 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 */ +/**/ + 691, /**/ 690, /**/