mirror of
https://github.com/junegunn/fzf.vim.git
synced 2025-12-06 12:44:24 +08:00
Handle SwapExists
Thanks to @justinmk
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user