vim-patch:8.1.0274: 'incsearch' triggers on ":source"

Problem:    'incsearch' triggers on ":source".
Solution:   Check for the whole command name.
21f990e1c2
This commit is contained in:
Aufar Gilbran
2020-08-10 19:06:51 +08:00
parent 5eb7133021
commit 9e834a89df
2 changed files with 70 additions and 22 deletions

View File

@@ -295,7 +295,10 @@ 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 (*p != NUL
&& (STRNCMP(cmd, "substitute", p - cmd) == 0
|| STRNCMP(cmd, "global", p - cmd) == 0
|| STRNCMP(cmd, "vglobal", p - cmd) == 0)) {
delim = *p++;
end = skip_regexp(p, delim, p_magic, NULL);
if (end > p) {