From 847c512539f9909ae69a5067c1a64cb9bb485ea3 Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Sun, 18 Dec 2016 18:51:19 +0100 Subject: [PATCH] s:execute_term: switch_back: check that self.pbuf exists (#776) With a `bufhidden=wipe` buffer (e.g. vim-startify) the buffer would not exist anymore, resulting in an error. --- plugin/fzf.vim | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugin/fzf.vim b/plugin/fzf.vim index 0cce53ab..2574a0fc 100644 --- a/plugin/fzf.vim +++ b/plugin/fzf.vim @@ -464,7 +464,9 @@ function! s:execute_term(dict, command, temps) abort \ 'columns': &columns, 'command': a:command } function! fzf.switch_back(inplace) if a:inplace && bufnr('') == self.buf - execute 'keepalt b' self.pbuf + if bufexists(self.pbuf) + execute 'keepalt b' self.pbuf + endif " No other listed buffer if bufnr('') == self.buf enew