mirror of
https://github.com/neovim/neovim.git
synced 2025-09-21 10:48:18 +00:00
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)
def7b1dc61
This commit is contained in:
@@ -299,6 +299,13 @@ static bool do_incsearch_highlighting(int firstc, incsearch_state_T *s,
|
|||||||
&& (STRNCMP(cmd, "substitute", p - cmd) == 0
|
&& (STRNCMP(cmd, "substitute", p - cmd) == 0
|
||||||
|| 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);
|
||||||
|
@@ -408,6 +408,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
|
||||||
|
Reference in New Issue
Block a user