1
0
forked from aniani/vim

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)
This commit is contained in:
Bram Moolenaar
2018-08-13 22:54:35 +02:00
parent 2b926fcb3c
commit def7b1dc61
3 changed files with 17 additions and 0 deletions

View File

@@ -298,6 +298,13 @@ do_incsearch_highlighting(int firstc, incsearch_state_T *is_state,
|| STRNCMP(cmd, "global", p - cmd) == 0 || STRNCMP(cmd, "global", p - cmd) == 0
|| STRNCMP(cmd, "vglobal", 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); p = skipwhite(p);
delim = *p++; delim = *p++;
end = skip_regexp(p, delim, p_magic, NULL); end = skip_regexp(p, delim, p_magic, NULL);

View File

@@ -399,6 +399,14 @@ func Test_search_cmdline3g()
undo undo
call feedkeys(":global/the\<c-l>/d\<cr>", 'tx') call feedkeys(":global/the\<c-l>/d\<cr>", 'tx')
call assert_equal(' 3 the theother', getline(2)) 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() call Incsearch_cleanup()
endfunc endfunc

View File

@@ -794,6 +794,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
280,
/**/ /**/
279, 279,
/**/ /**/