mirror of
https://github.com/neovim/neovim.git
synced 2026-07-19 23:51:38 +00:00
vim-patch:8.1.0279: 'incsearch' highlighting does not skip white space
Problem: 'incsearch' highlighting does not skip white space.
Solution: Skip white space after the command. (issue vim/vim#3321)
2b926fcb3c
This commit is contained in:
@@ -295,10 +295,11 @@ static bool do_incsearch_highlighting(int firstc, incsearch_state_T *s,
|
||||
if (*cmd == 's' || *cmd == 'g' || *cmd == 'v') {
|
||||
// Skip over "substitute" to find the pattern separator.
|
||||
for (p = cmd; ASCII_ISALPHA(*p); p++) {}
|
||||
if (*p != NUL
|
||||
if (*skipwhite(p) != NUL
|
||||
&& (STRNCMP(cmd, "substitute", p - cmd) == 0
|
||||
|| STRNCMP(cmd, "global", p - cmd) == 0
|
||||
|| STRNCMP(cmd, "vglobal", p - cmd) == 0)) {
|
||||
p = skipwhite(p);
|
||||
delim = *p++;
|
||||
end = skip_regexp(p, delim, p_magic, NULL);
|
||||
if (end > p || *end == delim) {
|
||||
|
||||
@@ -643,8 +643,14 @@ func Test_incsearch_substitute_dump()
|
||||
call term_sendkeys(buf, ':5,2s/foo')
|
||||
sleep 100m
|
||||
call VerifyScreenDump(buf, 'Test_incsearch_substitute_04', {})
|
||||
|
||||
call term_sendkeys(buf, "\<Esc>")
|
||||
|
||||
" White space after the command is skipped
|
||||
call term_sendkeys(buf, ':2,3sub /fo')
|
||||
sleep 100m
|
||||
call VerifyScreenDump(buf, 'Test_incsearch_substitute_05', {})
|
||||
call term_sendkeys(buf, "\<Esc>")
|
||||
|
||||
call StopVimInTerminal(buf)
|
||||
call delete('Xis_subst_script')
|
||||
endfunc
|
||||
|
||||
Reference in New Issue
Block a user