summaryrefslogtreecommitdiffstats
path: root/src/buffer.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2017-09-17 19:08:02 +0200
committerBram Moolenaar <Bram@vim.org>2017-09-17 19:08:02 +0200
commit8adb0d03ca2694922da915356d7ede05e31c5a5c (patch)
tree02beb7a3d74b14f880e22000ba1586bb4961fee9 /src/buffer.c
parent4033c55eca575777718c0701e26635a0cc47d907 (diff)
patch 8.0.1119: quitting a split terminal window kills the jobv8.0.1119
Problem: Quitting a split terminal window kills the job. (Yasuhiro Matsumoto) Solution: Only stop terminal job if it is the last window.
Diffstat (limited to 'src/buffer.c')
-rw-r--r--src/buffer.c40
1 files changed, 20 insertions, 20 deletions
diff --git a/src/buffer.c b/src/buffer.c
index 110dada7a6..7040bb1005 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -466,8 +466,27 @@ close_buffer(
int del_buf = (action == DOBUF_DEL || action == DOBUF_WIPE);
int wipe_buf = (action == DOBUF_WIPE);
+ /*
+ * Force unloading or deleting when 'bufhidden' says so.
+ * The caller must take care of NOT deleting/freeing when 'bufhidden' is
+ * "hide" (otherwise we could never free or delete a buffer).
+ */
+ if (buf->b_p_bh[0] == 'd') /* 'bufhidden' == "delete" */
+ {
+ del_buf = TRUE;
+ unload_buf = TRUE;
+ }
+ else if (buf->b_p_bh[0] == 'w') /* 'bufhidden' == "wipe" */
+ {
+ del_buf = TRUE;
+ unload_buf = TRUE;
+ wipe_buf = TRUE;
+ }
+ else if (buf->b_p_bh[0] == 'u') /* 'bufhidden' == "unload" */
+ unload_buf = TRUE;
+
#ifdef FEAT_TERMINAL
- if (bt_terminal(buf))
+ if (bt_terminal(buf) && (buf->b_nwindows == 1 || del_buf))
{
if (term_job_running(buf->b_term))
{
@@ -489,26 +508,7 @@ close_buffer(
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
- * "hide" (otherwise we could never free or delete a buffer).
- */
- if (buf->b_p_bh[0] == 'd') /* 'bufhidden' == "delete" */
- {
- del_buf = TRUE;
- unload_buf = TRUE;
- }
- else if (buf->b_p_bh[0] == 'w') /* 'bufhidden' == "wipe" */
- {
- del_buf = TRUE;
- unload_buf = TRUE;
- wipe_buf = TRUE;
- }
- else if (buf->b_p_bh[0] == 'u') /* 'bufhidden' == "unload" */
- unload_buf = TRUE;
#ifdef FEAT_AUTOCMD
/* Disallow deleting the buffer when it is locked (already being closed or