mirror of
https://github.com/junegunn/fzf.git
synced 2025-08-15 20:23:50 -07:00
[vim] Use close+bufhidden=wipe instead of bd
This commit is contained in:
@@ -272,7 +272,7 @@ function! s:split(dict)
|
|||||||
tabnew
|
tabnew
|
||||||
endif
|
endif
|
||||||
finally
|
finally
|
||||||
setlocal winfixwidth winfixheight
|
setlocal winfixwidth winfixheight buftype=nofile bufhidden=wipe nobuflisted
|
||||||
endtry
|
endtry
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
@@ -283,10 +283,14 @@ function! s:execute_term(dict, command, temps)
|
|||||||
let fzf = { 'buf': bufnr('%'), 'dict': a:dict, 'temps': a:temps }
|
let fzf = { 'buf': bufnr('%'), 'dict': a:dict, 'temps': a:temps }
|
||||||
function! fzf.on_exit(id, code)
|
function! fzf.on_exit(id, code)
|
||||||
let tab = tabpagenr()
|
let tab = tabpagenr()
|
||||||
let wnr = winnr()
|
if bufnr('') == self.buf
|
||||||
execute 'bd!' self.buf
|
" We use close instead of bd! since Vim does not close the split when
|
||||||
if winnr() == wnr && tabpagenr() == tab
|
" there's no other listed buffer
|
||||||
close
|
close
|
||||||
|
" FIXME This should be unnecessary due to `bufhidden=wipe` but in some
|
||||||
|
" cases Neovim fails to clean up the buffer and `bufexists('[FZF]')
|
||||||
|
" returns 1 even when it cannot be seen anywhere else. e.g. `FZF!`
|
||||||
|
silent! execute 'bd!' self.buf
|
||||||
endif
|
endif
|
||||||
if s:ptab == tab
|
if s:ptab == tab
|
||||||
wincmd p
|
wincmd p
|
||||||
|
Reference in New Issue
Block a user