diff options
author | Bram Moolenaar <Bram@vim.org> | 2017-11-21 14:47:57 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2017-11-21 14:47:57 +0100 |
commit | ff5467965e3871d3dc0288416fcc6b1e2ba4f822 (patch) | |
tree | 7ef859cb24a0f4db34f47e20fdcaca09b2e57152 /src/terminal.c | |
parent | 91ffda9852916004c9f318cd01b2f90751329bad (diff) | |
download | vim-git-8.0.1328.tar.gz |
patch 8.0.1328: trouble when using ":term ++close" with autocmdv8.0.1328
Problem: Trouble when using ":term ++close" with autocmd. (Gabriel Barta)
Solution: Use aucmd_prepbuf() and aucmd_restbuf() instead of setting curbuf.
(closes #2339)
Diffstat (limited to 'src/terminal.c')
-rw-r--r-- | src/terminal.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/terminal.c b/src/terminal.c index a4caa42ed..2e6b39918 100644 --- a/src/terminal.c +++ b/src/terminal.c @@ -51,6 +51,7 @@ * - implement term_setsize() * - Termdebug does not work when Vim build with mzscheme. gdb hangs. * - MS-Windows GUI: WinBar has tearoff item + * - Adding WinBar to terminal window doesn't display, text isn't shifted down. * - MS-Windows GUI: still need to type a key after shell exits? #1924 * - After executing a shell command the status line isn't redraw. * - What to store in a session file? Shell at the prompt would be OK to @@ -2172,10 +2173,13 @@ term_channel_closed(channel_T *ch) if (term->tl_finish == 'c') { + aco_save_T aco; + /* ++close or term_finish == "close" */ ch_log(NULL, "terminal job finished, closing window"); - curbuf = term->tl_buffer; + aucmd_prepbuf(&aco, term->tl_buffer); do_bufdel(DOBUF_WIPE, (char_u *)"", 1, fnum, fnum, FALSE); + aucmd_restbuf(&aco); break; } if (term->tl_finish == 'o' && term->tl_buffer->b_nwindows == 0) |