From 6b357c7cde32a29527651cf89298f0f795eca364 Mon Sep 17 00:00:00 2001 From: wsdjeg Date: Tue, 12 Apr 2022 21:43:01 +0800 Subject: [PATCH] fix(iedit): fix iedit matching pattern close https://github.com/SpaceVim/SpaceVim/issues/4618 --- autoload/SpaceVim/api/data/string.vim | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/autoload/SpaceVim/api/data/string.vim b/autoload/SpaceVim/api/data/string.vim index 68e33dfc7..8e1212c25 100644 --- a/autoload/SpaceVim/api/data/string.vim +++ b/autoload/SpaceVim/api/data/string.vim @@ -153,10 +153,11 @@ function! s:self.strAllIndex(str, need, use_expr) abort return rst else let rst = [] - let idx = match(a:str, "\\<" . a:need . "\\>") + let pattern = '\<\V' . a:need . '\ze\W\|\<\V' . a:need . '\ze\$' + let idx = match(a:str, pattern) while idx != -1 call add(rst, [idx, idx+len(a:need)]) - let idx = match(a:str, "\\<" . a:need . "\\>", idx + 1 + len(a:need)) + let idx = match(a:str, pattern, idx + 1 + len(a:need)) endwhile return rst endif