mirror of
https://github.com/Llewellynvdm/fzf.git
synced 2024-11-29 00:06:29 +00:00
[vim] Open selected file in the current window if it's empty
Close #451
This commit is contained in:
parent
ac0a62e494
commit
b5850ebd4c
@ -409,10 +409,16 @@ function! s:cmd_callback(lines) abort
|
|||||||
augroup END
|
augroup END
|
||||||
endif
|
endif
|
||||||
try
|
try
|
||||||
|
let empty = empty(expand('%')) && line('$') == 1 && empty(getline(1)) && !&modified
|
||||||
let autochdir = &autochdir
|
let autochdir = &autochdir
|
||||||
set noautochdir
|
set noautochdir
|
||||||
for item in a:lines
|
for item in a:lines
|
||||||
|
if empty
|
||||||
|
execute 'e' s:escape(item)
|
||||||
|
let empty = 0
|
||||||
|
else
|
||||||
execute cmd s:escape(item)
|
execute cmd s:escape(item)
|
||||||
|
endif
|
||||||
if exists('#BufEnter') && isdirectory(item)
|
if exists('#BufEnter') && isdirectory(item)
|
||||||
doautocmd BufEnter
|
doautocmd BufEnter
|
||||||
endif
|
endif
|
||||||
|
Loading…
Reference in New Issue
Block a user