Skip to content

Commit

Permalink
close nvim floating window then delete buffer
Browse files Browse the repository at this point in the history
fixes #67
  • Loading branch information
mcchrish committed Oct 6, 2020
1 parent 02c625f commit f8bac88
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions autoload/nnn.vim
Original file line number Diff line number Diff line change
Expand Up @@ -200,20 +200,20 @@ 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)
endif
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)
Expand Down

0 comments on commit f8bac88

Please sign in to comment.