mirror of
https://github.com/Llewellynvdm/fzf.git
synced 2024-11-10 15:50:56 +00:00
Merge pull request #361 from justinmk/swapexists
[vim] handle SwapExists
This commit is contained in:
commit
6a38d07a4c
@ -405,6 +405,12 @@ function! s:cmd_callback(lines) abort
|
||||
endif
|
||||
let key = remove(a:lines, 0)
|
||||
let cmd = get(s: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
|
||||
@ -413,6 +419,7 @@ function! s:cmd_callback(lines) abort
|
||||
endfor
|
||||
finally
|
||||
let &autochdir = autochdir
|
||||
silent! autocmd! fzf_swap
|
||||
endtry
|
||||
endfunction
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user