mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-03-14 10:45:42 +08:00
fix(flygrep): fix flygrep replace mode with grep command
This commit is contained in:
parent
5b76a80c40
commit
a7bedbc5dc
@ -279,7 +279,13 @@ function! s:flygrep_result_to_files() abort
|
|||||||
for line in getbufline(s:flygrep_buffer_id, 1, '$')
|
for line in getbufline(s:flygrep_buffer_id, 1, '$')
|
||||||
let filename = fnameescape(split(line, ':\d\+:')[0])
|
let filename = fnameescape(split(line, ':\d\+:')[0])
|
||||||
let linenr = matchstr(line, ':\d\+:')[1:-2]
|
let linenr = matchstr(line, ':\d\+:')[1:-2]
|
||||||
let str = matchstr(line, '\(:\d\+:\d\+:\)\@<=.*')
|
" if the search command is grep, the searching result is
|
||||||
|
" helloworld.vim:12: echo 'hello'
|
||||||
|
" echo matchstr("helloworld.vim:12: echo 'hello'", '\(:\d\+:\)\@<=.*')
|
||||||
|
" ` echo 'hello'`
|
||||||
|
" echo matchstr("helloworld.vim:1:12: echo 'hello'", '\(:\d\+:\)\@<=.*')
|
||||||
|
" ` echo 'hello'`
|
||||||
|
let str = matchstr(line, '\(:\d\+:\)\@<=.*')
|
||||||
call add(files, [filename, linenr, str])
|
call add(files, [filename, linenr, str])
|
||||||
endfor
|
endfor
|
||||||
return files
|
return files
|
||||||
|
Loading…
x
Reference in New Issue
Block a user