From f8bac88a3591be157ac73fed24c2fc525bb73b27 Mon Sep 17 00:00:00 2001 From: Michael Chris Lopez Date: Tue, 6 Oct 2020 16:35:15 +0800 Subject: [PATCH] close nvim floating window then delete buffer fixes #67 --- autoload/nnn.vim | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/autoload/nnn.vim b/autoload/nnn.vim index d9c34ef..765e968 100644 --- a/autoload/nnn.vim +++ b/autoload/nnn.vim @@ -200,13 +200,6 @@ function! s:switch_back(opts, Cmd) throw 'Invalid layout' endif if has('nvim') - if bufexists(l:term_wins.term.buf) - execute 'bwipeout!' l:term_wins.term.buf - endif - if bufexists(l:term_wins.frame.buf) - execute 'bwipeout!' l:term_wins.frame.buf - endif - " Making sure we close the windows when sometimes they linger if nvim_win_is_valid(l:term_wins.term.winhandle) call nvim_win_close(l:term_wins.term.winhandle, v:false) @@ -214,6 +207,13 @@ function! s:switch_back(opts, Cmd) if nvim_win_is_valid(l:term_wins.frame.winhandle) call nvim_win_close(l:term_wins.frame.winhandle, v:false) endif + + if bufexists(l:term_wins.term.buf) + execute 'bwipeout!' l:term_wins.term.buf + endif + if bufexists(l:term_wins.frame.buf) + execute 'bwipeout!' l:term_wins.frame.buf + endif else call popup_close(l:term_wins.term.winhandle) call popup_close(l:term_wins.frame.winhandle)