1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-02-03 04:50:04 +08:00

Fix bug: can't open files with space in names

close https://github.com/wsdjeg/FlyGrep.vim/issues/3
This commit is contained in:
wsdjeg 2017-07-25 07:33:31 +08:00
parent 4f39f053d6
commit ffa86f2cd9

View File

@ -126,22 +126,18 @@ function! s:previous_item() abort
endfunction endfunction
function! s:open_item() abort function! s:open_item() abort
if line('.') !=# '' if getline('.') !=# ''
if s:grepid != 0 if s:grepid != 0
call s:JOB.stop(s:grepid) call s:JOB.stop(s:grepid)
endif endif
call s:MPT._clear_prompt() call s:MPT._clear_prompt()
let s:MPT._quit = 1 let s:MPT._quit = 1
let isfname = &isfname let line = getline('.')
if s:SYS.isWindows let filename = fnameescape(split(line, ':\d\+:')[0])
set isfname-=: let linenr = matchstr(line, ':\d\+:')[1:-2]
endif
normal! gF
let nr = bufnr('%')
q q
exe 'silent b' . nr exe 'e ' . filename
normal! : exe linenr
let &isfname = isfname
endif endif
endfunction endfunction