mirror of
https://github.com/vim/vim.git
synced 2025-07-26 11:04:33 -04:00
patch 8.2.2040: terminal buffer disappears even when 'bufhidden' is "hide"
Problem: Terminal buffer disappears even when 'bufhidden' is "hide". (Sergey Vlasov) Solution: Check 'bufhiddden' when a terminal buffer becomes hidden. (closes #7358)
This commit is contained in:
parent
8e6be34338
commit
c9f8b849b6
@ -552,6 +552,11 @@ close_buffer(
|
|||||||
unload_buf = FALSE;
|
unload_buf = FALSE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if (buf->b_p_bh[0] == 'h' && !del_buf)
|
||||||
|
{
|
||||||
|
// Hide a terminal buffer.
|
||||||
|
unload_buf = FALSE;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// A terminal buffer is wiped out if the job has finished.
|
// A terminal buffer is wiped out if the job has finished.
|
||||||
|
@ -123,7 +123,7 @@ func Test_terminal_split_quit()
|
|||||||
unlet g:job
|
unlet g:job
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
func Test_terminal_hide_buffer()
|
func Test_terminal_hide_buffer_job_running()
|
||||||
let buf = Run_shell_in_terminal({})
|
let buf = Run_shell_in_terminal({})
|
||||||
setlocal bufhidden=hide
|
setlocal bufhidden=hide
|
||||||
quit
|
quit
|
||||||
@ -140,6 +140,25 @@ func Test_terminal_hide_buffer()
|
|||||||
unlet g:job
|
unlet g:job
|
||||||
endfunc
|
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)
|
func s:Nasty_exit_cb(job, st)
|
||||||
exe g:buf . 'bwipe!'
|
exe g:buf . 'bwipe!'
|
||||||
let g:buf = 0
|
let g:buf = 0
|
||||||
|
@ -750,6 +750,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
2040,
|
||||||
/**/
|
/**/
|
||||||
2039,
|
2039,
|
||||||
/**/
|
/**/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user