Mercurial > vim
comparison src/buffer.c @ 11917:00836eb177cb v8.0.0838
patch 8.0.0838: buffer hangs around whem terminal window is closed
commit https://github.com/vim/vim/commit/94053a51255121713f51c122eb0dbb46c120e6d4
Author: Bram Moolenaar <Bram@vim.org>
Date: Tue Aug 1 21:44:33 2017 +0200
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.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Tue, 01 Aug 2017 21:45:04 +0200 |
parents | 0cfe4a07c2ad |
children | bc0fee081e1e |
comparison
equal
deleted
inserted
replaced
11916:de8aede995aa | 11917:00836eb177cb |
---|---|
466 #endif | 466 #endif |
467 int unload_buf = (action != 0); | 467 int unload_buf = (action != 0); |
468 int del_buf = (action == DOBUF_DEL || action == DOBUF_WIPE); | 468 int del_buf = (action == DOBUF_DEL || action == DOBUF_WIPE); |
469 int wipe_buf = (action == DOBUF_WIPE); | 469 int wipe_buf = (action == DOBUF_WIPE); |
470 | 470 |
471 #ifdef FEAT_TERMINAL | |
472 if (bt_terminal(buf)) | |
473 { | |
474 if (term_job_running(buf->b_term)) | |
475 { | |
476 if (wipe_buf) | |
477 /* Wiping out a terminal buffer kills the job. */ | |
478 free_terminal(buf); | |
479 else | |
480 { | |
481 /* The job keeps running, hide the buffer. */ | |
482 del_buf = FALSE; | |
483 unload_buf = FALSE; | |
484 } | |
485 } | |
486 else | |
487 { | |
488 /* A terminal buffer is wiped out if the job has finished. */ | |
489 del_buf = TRUE; | |
490 unload_buf = TRUE; | |
491 wipe_buf = TRUE; | |
492 } | |
493 } | |
494 else | |
495 #endif | |
471 /* | 496 /* |
472 * Force unloading or deleting when 'bufhidden' says so. | 497 * Force unloading or deleting when 'bufhidden' says so. |
473 * The caller must take care of NOT deleting/freeing when 'bufhidden' is | 498 * The caller must take care of NOT deleting/freeing when 'bufhidden' is |
474 * "hide" (otherwise we could never free or delete a buffer). | 499 * "hide" (otherwise we could never free or delete a buffer). |
475 */ | 500 */ |