diff --git a/src/ex_getln.c b/src/ex_getln.c index ba8fde65e9497..11de136bf78c5 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 730e683911406..18a4577b7f7fb 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 7bf3f4e9c68f2..64f035dbd9bda 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, /**/