diff options
author | Michal Domonkos <mdomonko@redhat.com> | 2020-11-17 06:37:14 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-17 14:37:14 +0900 |
commit | 1ed25d76ba51f9b3ab66f75b73734be43d41b8c3 (patch) | |
tree | ebb462c9e343e1bf7d90d5b5c56e383e5e914f3e /plugin | |
parent | 474c1f5e32cc56653b1a1be697abf92537e4e28f (diff) |
[vim] Clean up temp files on interrupt (#2252)
The clean-up is done in s:collect(), so let's make sure it's run before
we may terminate due to CTRL-C or ESC (or some other error code) in
s:exit_handler().
Diffstat (limited to 'plugin')
-rw-r--r-- | plugin/fzf.vim | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/plugin/fzf.vim b/plugin/fzf.vim index 06f79590..247df973 100644 --- a/plugin/fzf.vim +++ b/plugin/fzf.vim @@ -645,7 +645,8 @@ function! s:execute(dict, command, use_height, temps) abort endif let exit_status = v:shell_error redraw! - return s:exit_handler(exit_status, command) ? s:collect(a:temps) : [] + let lines = s:collect(a:temps) + return s:exit_handler(exit_status, command) ? lines : [] endfunction function! s:execute_tmux(dict, command, temps) abort @@ -659,7 +660,8 @@ function! s:execute_tmux(dict, command, temps) abort call system(command) let exit_status = v:shell_error redraw! - return s:exit_handler(exit_status, command) ? s:collect(a:temps) : [] + let lines = s:collect(a:temps) + return s:exit_handler(exit_status, command) ? lines : [] endfunction function! s:calc_size(max, val, dict) @@ -806,12 +808,12 @@ function! s:execute_term(dict, command, temps) abort execute self.winrest endif + let lines = s:collect(self.temps) if !s:exit_handler(a:code, self.command, 1) return endif call s:pushd(self.dict) - let lines = s:collect(self.temps) call s:callback(self.dict, lines) call self.switch_back(s:getpos() == self.ppos) endfunction |