0
0
mirror of https://github.com/vim/vim.git synced 2025-09-30 04:44:14 -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. // Skip over "substitute" to find the pattern separator.
for (p = cmd; ASCII_ISALPHA(*p); ++p) for (p = cmd; ASCII_ISALPHA(*p); ++p)
; ;
if (*p != NUL if (*skipwhite(p) != NUL
&& (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))
{ {
p = skipwhite(p);
delim = *p++; delim = *p++;
end = skip_regexp(p, delim, p_magic, NULL); end = skip_regexp(p, delim, p_magic, NULL);
if (end > p || *end == delim) if (end > p || *end == delim)

View File

@@ -0,0 +1,9 @@
|f+0&#ffffff0|o@1| |1| @64
|f+1&&|o|o+0&&| |2| @64
|f+0&#ffff4012|o|o+0&#ffffff0| |3| @64
|f|o@1| |4| @64
|f|o@1| |5| @64
|f|o@1| |6| @64
|f|o@1| |7| @64
|f|o@1| |8| @64
|:|2|,|3|s|u|b| @1|/|f|o> @57

View File

@@ -868,8 +868,14 @@ func Test_incsearch_substitute_dump()
call term_sendkeys(buf, ':5,2s/foo') call term_sendkeys(buf, ':5,2s/foo')
sleep 100m sleep 100m
call VerifyScreenDump(buf, 'Test_incsearch_substitute_04', {}) call VerifyScreenDump(buf, 'Test_incsearch_substitute_04', {})
call term_sendkeys(buf, "\<Esc>") 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 StopVimInTerminal(buf)
call delete('Xis_subst_script') call delete('Xis_subst_script')
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 */
/**/
279,
/**/ /**/
278, 278,
/**/ /**/