Skip to content

Commit a997a8f

Browse files
authored
Merge pull request #94 from mizlan/master
Delete the nnn window on exit
2 parents 422cd80 + 4289727 commit a997a8f

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

autoload/nnn.vim

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,14 @@ function! s:switch_back(opts, Cmd)
232232
if (type(a:Cmd) == v:t_string && a:Cmd != 'edit')
233233
\ || (type(l:layout) != v:t_string
234234
\ || (type(l:layout) == v:t_string && l:layout != 'enew'))
235+
" delete the nnn window and buffer
236+
if has('nvim')
237+
if nvim_win_is_valid(l:term_wins.term.winhandle)
238+
call nvim_win_close(l:term_wins.term.winhandle, v:false)
239+
endif
240+
else
241+
call popup_close(l:term_wins.term.winhandle)
242+
endif
235243
if bufexists(l:term_wins.term.buf)
236244
execute 'bwipeout!' l:term_wins.term.buf
237245
endif

0 commit comments

Comments
 (0)