From 8ae47ddf63bdc6e880eac2f5752da137507a34c0 Mon Sep 17 00:00:00 2001 From: Aufar Gilbran Date: Tue, 11 Aug 2020 00:49:12 +0800 Subject: 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) https://github.com/vim/vim/commit/2b926fcb3c5d8bd09a219009336bbec7c66ae67e --- src/nvim/ex_getln.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/nvim/ex_getln.c') diff --git a/src/nvim/ex_getln.c b/src/nvim/ex_getln.c index a1a889d652..6a60592f14 100644 --- a/src/nvim/ex_getln.c +++ b/src/nvim/ex_getln.c @@ -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) { -- cgit