summaryrefslogtreecommitdiff
path: root/src/testdir/test_terminal.vim
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2020-11-24 19:36:16 +0100
committerBram Moolenaar <Bram@vim.org>2020-11-24 19:36:16 +0100
commitc9f8b849b6de9661e543d0d1431e233725dd956f (patch)
treef0471ebdbb83dc7055fbaed72bc0f71319d1a0e0 /src/testdir/test_terminal.vim
parent8e6be34338f13a6a625f19bcef82019c9adc65f2 (diff)
downloadvim-git-c9f8b849b6de9661e543d0d1431e233725dd956f.tar.gz
patch 8.2.2040: terminal buffer disappears even when 'bufhidden' is "hide"v8.2.2040
Problem: Terminal buffer disappears even when 'bufhidden' is "hide". (Sergey Vlasov) Solution: Check 'bufhiddden' when a terminal buffer becomes hidden. (closes #7358)
Diffstat (limited to 'src/testdir/test_terminal.vim')
-rw-r--r--src/testdir/test_terminal.vim21
1 files changed, 20 insertions, 1 deletions
diff --git a/src/testdir/test_terminal.vim b/src/testdir/test_terminal.vim
index cef379a57..8d47c0886 100644
--- a/src/testdir/test_terminal.vim
+++ b/src/testdir/test_terminal.vim
@@ -123,7 +123,7 @@ func Test_terminal_split_quit()
unlet g:job
endfunc
-func Test_terminal_hide_buffer()
+func Test_terminal_hide_buffer_job_running()
let buf = Run_shell_in_terminal({})
setlocal bufhidden=hide
quit
@@ -140,6 +140,25 @@ func Test_terminal_hide_buffer()
unlet g:job
endfunc
+func Test_terminal_hide_buffer_job_finished()
+ term echo hello
+ let buf = bufnr()
+ setlocal bufhidden=hide
+ call WaitForAssert({-> assert_equal('finished', term_getstatus(buf))})
+ call assert_true(bufloaded(buf))
+ call assert_true(buflisted(buf))
+ edit Xasdfasdf
+ call assert_true(bufloaded(buf))
+ call assert_true(buflisted(buf))
+ exe buf .. 'buf'
+ call assert_equal(buf, bufnr())
+ setlocal bufhidden=
+ edit Xasdfasdf
+ call assert_false(bufloaded(buf))
+ call assert_false(buflisted(buf))
+ bwipe Xasdfasdf
+endfunc
+
func s:Nasty_exit_cb(job, st)
exe g:buf . 'bwipe!'
let g:buf = 0