0
0
mirror of https://github.com/vim/vim.git synced 2025-10-05 05:34:07 -04:00

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 #3321)
This commit is contained in:
Bram Moolenaar
2018-08-13 11:07:57 +02:00
parent 60d0871000
commit 2b926fcb3c
4 changed files with 20 additions and 2 deletions

View File

@@ -293,11 +293,12 @@ do_incsearch_highlighting(int firstc, incsearch_state_T *is_state,
// 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)