Handle SwapExists

Thanks to @justinmk
This commit is contained in:
Junegunn Choi
2015-09-30 16:19:31 +09:00
parent 4dd84d7165
commit c70fa2b6fb

View File

@@ -76,6 +76,12 @@ function! s:common_sink(lines) abort
endif
let key = remove(a:lines, 0)
let cmd = get(get(g:, 'fzf_action', s:default_action), key, 'e')
if len(a:lines) > 1
augroup fzf_swap
autocmd SwapExists * let v:swapchoice='o'
\| call s:warn('fzf: E325: swap file exists: '.expand('<afile>'))
augroup END
endif
try
let autochdir = &autochdir
set noautochdir
@@ -84,6 +90,7 @@ function! s:common_sink(lines) abort
endfor
finally
let &autochdir = autochdir
silent! autocmd! fzf_swap
endtry
endfunction