1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-01-23 22:40:04 +08:00

fix(flygrep): fix replace mode of flygrep

This commit is contained in:
Shidong Wang 2021-10-16 17:16:20 +08:00
parent b2d1d74606
commit 63c2bbf5af
No known key found for this signature in database
GPG Key ID: 41BB7053E835C848

View File

@ -281,11 +281,11 @@ function! s:flygrep_result_to_files() abort
let linenr = matchstr(line, ':\d\+:')[1:-2]
" if the search command is grep, the searching result is
" helloworld.vim:12: echo 'hello'
" echo matchstr("helloworld.vim:12: echo 'hello'", '\(:\d\+:\)\@<=.*')
" echo matchstr("helloworld.vim:12: echo 'hello'", '\(:\d\+\)\+:\zs.*')
" ` echo 'hello'`
" echo matchstr("helloworld.vim:1:12: echo 'hello'", '\(:\d\+:\)\@<=.*')
" echo matchstr("helloworld.vim:1:12: echo 'hello'", '\(:\d\+\)\+:\zs.*')
" ` echo 'hello'`
let str = matchstr(line, '\(:\d\+:\)\@<=.*')
let str = matchstr(line, '\(:\d\+\)\+:\zs.*')
call add(files, [filename, linenr, str])
endfor
return files