mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-03-15 19:45:46 +08:00
fix(iedit): fix iedit matching pattern
close https://github.com/SpaceVim/SpaceVim/issues/4618
This commit is contained in:
parent
39cbef5f3f
commit
6b357c7cde
@ -153,10 +153,11 @@ function! s:self.strAllIndex(str, need, use_expr) abort
|
|||||||
return rst
|
return rst
|
||||||
else
|
else
|
||||||
let rst = []
|
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
|
while idx != -1
|
||||||
call add(rst, [idx, idx+len(a:need)])
|
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
|
endwhile
|
||||||
return rst
|
return rst
|
||||||
endif
|
endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user