mirror of
https://github.com/vim/vim.git
synced 2025-09-23 03:43:49 -04:00
patch 8.0.0838: buffer hangs around whem terminal window is closed
Problem: Buffer hangs around whem terminal window is closed. Solution: When the job has ended wipe out a terminal buffer when the window is closed.
This commit is contained in:
25
src/buffer.c
25
src/buffer.c
@@ -468,6 +468,31 @@ close_buffer(
|
||||
int del_buf = (action == DOBUF_DEL || action == DOBUF_WIPE);
|
||||
int wipe_buf = (action == DOBUF_WIPE);
|
||||
|
||||
#ifdef FEAT_TERMINAL
|
||||
if (bt_terminal(buf))
|
||||
{
|
||||
if (term_job_running(buf->b_term))
|
||||
{
|
||||
if (wipe_buf)
|
||||
/* Wiping out a terminal buffer kills the job. */
|
||||
free_terminal(buf);
|
||||
else
|
||||
{
|
||||
/* The job keeps running, hide the buffer. */
|
||||
del_buf = FALSE;
|
||||
unload_buf = FALSE;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/* A terminal buffer is wiped out if the job has finished. */
|
||||
del_buf = TRUE;
|
||||
unload_buf = TRUE;
|
||||
wipe_buf = TRUE;
|
||||
}
|
||||
}
|
||||
else
|
||||
#endif
|
||||
/*
|
||||
* Force unloading or deleting when 'bufhidden' says so.
|
||||
* The caller must take care of NOT deleting/freeing when 'bufhidden' is
|
||||
|
Reference in New Issue
Block a user