diff options
author | Marco Hinz <mh.codebro@gmail.com> | 2019-11-11 16:47:05 +0100 |
---|---|---|
committer | Junegunn Choi <junegunn.c@gmail.com> | 2019-11-12 00:47:05 +0900 |
commit | 16fc6862a89eef0f02d32ab8b365887522719da8 (patch) | |
tree | 169927fa54ea12bfcaa9dd0b101ba99cbb6791e2 | |
parent | dceb5d09cdb0d3158a3f79e59eb3c16ffe242d6b (diff) |
[nvim] Handle SIGHUP in exit handler (#1749)
In recent Nvim versions, an "Error running ..." message is shown even for normal
use cases, such as:
:Files
<c-\><c-n>
:close
Closing the window will :bwipeout! the terminal buffer, because fzf sets
bufhiden=wipe.
When deleting the terminal buffer while fzf is still running, Nvim sends SIGHUP.
This happens for quite some time already, but the bug only manifests since this
commit:
https://github.com/neovim/neovim/commit/939d9053b
It's The Right Thing to do when the application exited due to a signal.
Before that commit, no "Error running ..." message was shown, because 1 (instead
of 128 + 1 == SIGHUP) was returned which the exit handler in fzf.vim treats as
"NO MATCH".
-rw-r--r-- | plugin/fzf.vim | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/plugin/fzf.vim b/plugin/fzf.vim index 195bb8b2..7781ae5f 100644 --- a/plugin/fzf.vim +++ b/plugin/fzf.vim @@ -527,6 +527,10 @@ endif function! s:exit_handler(code, command, ...) if a:code == 130 return 0 + elseif has('nvim') && a:code == 129 + " When deleting the terminal buffer while fzf is still running, + " Nvim sends SIGHUP. + return 0 elseif a:code > 1 call s:error('Error running ' . a:command) if !empty(a:000) |