# HG changeset patch # User Christian Brabandt # Date 1534194005 -7200 # Node ID 8fa7f5ff2649990988b1b43b0dcfadd8c414b56f # Parent 358090a18f5b5da8ce52852654a353b8fff4fa6e patch 8.1.0280: 'incsearch' highlighting does not work for ":g!/" commit https://github.com/vim/vim/commit/def7b1dc6104a6ce6d7c3e3a615231178601b124 Author: Bram Moolenaar Date: Mon Aug 13 22:54:35 2018 +0200 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) diff --git a/src/ex_getln.c b/src/ex_getln.c --- a/src/ex_getln.c +++ b/src/ex_getln.c @@ -298,6 +298,13 @@ do_incsearch_highlighting(int firstc, in || 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 --- 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 --- 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,