From def7b1dc6104a6ce6d7c3e3a615231178601b124 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Mon, 13 Aug 2018 22:54:35 +0200 Subject: patch 8.1.0280: 'incsearch' highlighting does not work for ":g!/" Problem: 'incsearch' highlighting does not work for ":g!/". Solution: Skip the exclamation mark. (Hirohito Higashi) --- src/ex_getln.c | 7 +++++++ src/testdir/test_search.vim | 8 ++++++++ src/version.c | 2 ++ 3 files changed, 17 insertions(+) (limited to 'src') diff --git a/src/ex_getln.c b/src/ex_getln.c index 8765ac5b2..fb16743f0 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 05046b3c0..8d4b7cc60 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\/d\", 'tx') call assert_equal(' 3 the theother', getline(2)) + undo + call feedkeys(":g!/the\/d\", 'tx') + call assert_equal(1, line('$')) + call assert_equal(' 2 the~e', getline(1)) + undo + call feedkeys(":global!/the\/d\", '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 4a9dd1423..145099220 100644 --- a/src/version.c +++ b/src/version.c @@ -794,6 +794,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 280, /**/ 279, /**/ -- cgit v1.2.1