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.
This commit is contained in:
Daniel Hahler 2016-12-18 18:51:19 +01:00 committed by Junegunn Choi
parent 97330ee8fc
commit 847c512539

View File

@ -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