mirror of
https://github.com/junegunn/fzf.git
synced 2025-11-17 07:43:39 -05:00
[neovim] Make sure that fzf buffer is closed (#225)
- bd! leaves the window open when there's no other listed buffer - redraw! seems to help avoid Neovim issues.
This commit is contained in:
@@ -283,12 +283,17 @@ 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()
|
||||||
execute 'bd!' self.buf
|
execute 'bd!' self.buf
|
||||||
|
if winnr() == wnr
|
||||||
|
close
|
||||||
|
endif
|
||||||
if s:ptab == tab
|
if s:ptab == tab
|
||||||
wincmd p
|
wincmd p
|
||||||
endif
|
endif
|
||||||
call s:pushd(self.dict)
|
call s:pushd(self.dict)
|
||||||
try
|
try
|
||||||
|
redraw!
|
||||||
call s:callback(self.dict, self.temps)
|
call s:callback(self.dict, self.temps)
|
||||||
finally
|
finally
|
||||||
call s:popd(self.dict)
|
call s:popd(self.dict)
|
||||||
|
|||||||
Reference in New Issue
Block a user