summaryrefslogtreecommitdiffstats
path: root/plugin
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2015-09-29 23:32:48 -0400
committerJustin M. Keyes <justinkz@gmail.com>2015-09-30 02:48:12 -0400
commitc4e5ee63bb4f68a80efd7f931b65c766281fbdea (patch)
treed49f1888530574ae68aabddb0ff019038d216047 /plugin
parent862da2c0b1ea2d607f9e626ee3ee8508a583bbc1 (diff)
[vim] handle SwapExists
The SwapExists dialog prevents multiple files from being opening if the dialog occurs before all files are opened. Opening the files is more important than showing the dialog, so choose "readonly" automatically and continue opening files.
Diffstat (limited to 'plugin')
-rw-r--r--plugin/fzf.vim7
1 files changed, 7 insertions, 0 deletions
diff --git a/plugin/fzf.vim b/plugin/fzf.vim
index d37e53b2..168bc619 100644
--- a/plugin/fzf.vim
+++ b/plugin/fzf.vim
@@ -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