summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2018-08-13 22:54:35 +0200
committerBram Moolenaar <Bram@vim.org>2018-08-13 22:54:35 +0200
commitdef7b1dc6104a6ce6d7c3e3a615231178601b124 (patch)
tree6257847535525b07ee58fb21dd35630c457a089e
parent2b926fcb3c5d8bd09a219009336bbec7c66ae67e (diff)
patch 8.1.0280: 'incsearch' highlighting does not work for ":g!/"v8.1.0280
Problem: 'incsearch' highlighting does not work for ":g!/". Solution: Skip the exclamation mark. (Hirohito Higashi)
-rw-r--r--src/ex_getln.c7
-rw-r--r--src/testdir/test_search.vim8
-rw-r--r--src/version.c2
3 files changed, 17 insertions, 0 deletions
diff --git a/src/ex_getln.c b/src/ex_getln.c
index 8765ac5b24..fb16743f0c 100644
--- a/src/ex_getln.c
+++ b/src/ex_getln.c
@@ -298,6 +298,13 @@ do_incsearch_highlighting(int firstc, incsearch_state_T *is_state,
|| STRNCMP(cmd, "global", p - cmd) == 0
|| STRNCMP(cmd, "vglobal", p - cmd) == 0))
{
+ // Check for "global!/".
+ if (*cmd == 'g' && *p == '!')
+ {
+ p++;
+ if (*skipwhite(p) == NUL)
+ return FALSE;
+ }
p = skipwhite(p);
delim = *p++;
end = skip_regexp(p, delim, p_magic, NULL);
diff --git a/src/testdir/test_search.vim b/src/testdir/test_search.vim
index 05046b3c0f..8d4b7cc604 100644
--- a/src/testdir/test_search.vim
+++ b/src/testdir/test_search.vim
@@ -399,6 +399,14 @@ func Test_search_cmdline3g()
undo
call feedkeys(":global/the\<c-l>/d\<cr>", 'tx')
call assert_equal(' 3 the theother', getline(2))
+ undo
+ call feedkeys(":g!/the\<c-l>/d\<cr>", 'tx')
+ call assert_equal(1, line('$'))
+ call assert_equal(' 2 the~e', getline(1))
+ undo
+ call feedkeys(":global!/the\<c-l>/d\<cr>", 'tx')
+ call assert_equal(1, line('$'))
+ call assert_equal(' 2 the~e', getline(1))
call Incsearch_cleanup()
endfunc
diff --git a/src/version.c b/src/version.c
index 4a9dd14232..1450992209 100644
--- a/src/version.c
+++ b/src/version.c
@@ -795,6 +795,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 280,
+/**/
279,
/**/
278,