comparison src/terminal.c @ 12903:411a30bd7e8a v8.0.1328

patch 8.0.1328: trouble when using ":term ++close" with autocmd commit https://github.com/vim/vim/commit/ff5467965e3871d3dc0288416fcc6b1e2ba4f822 Author: Bram Moolenaar <Bram@vim.org> Date: Tue Nov 21 14:47:57 2017 +0100 patch 8.0.1328: trouble when using ":term ++close" with autocmd Problem: Trouble when using ":term ++close" with autocmd. (Gabriel Barta) Solution: Use aucmd_prepbuf() and aucmd_restbuf() instead of setting curbuf. (closes #2339)
author Christian Brabandt <cb@256bit.org>
date Tue, 21 Nov 2017 15:00:06 +0100
parents 40ae30bc2691
children 32531a3eab1f
comparison
equal deleted inserted replaced
12902:9e528acde057 12903:411a30bd7e8a
49 * saving the buffer. Should say something else. (Manas Thakur, #2215) 49 * saving the buffer. Should say something else. (Manas Thakur, #2215)
50 * Also: #2223 50 * Also: #2223
51 * - implement term_setsize() 51 * - implement term_setsize()
52 * - Termdebug does not work when Vim build with mzscheme. gdb hangs. 52 * - Termdebug does not work when Vim build with mzscheme. gdb hangs.
53 * - MS-Windows GUI: WinBar has tearoff item 53 * - MS-Windows GUI: WinBar has tearoff item
54 * - Adding WinBar to terminal window doesn't display, text isn't shifted down.
54 * - MS-Windows GUI: still need to type a key after shell exits? #1924 55 * - MS-Windows GUI: still need to type a key after shell exits? #1924
55 * - After executing a shell command the status line isn't redraw. 56 * - After executing a shell command the status line isn't redraw.
56 * - What to store in a session file? Shell at the prompt would be OK to 57 * - What to store in a session file? Shell at the prompt would be OK to
57 * restore, but others may not. Open the window and let the user start the 58 * restore, but others may not. Open the window and let the user start the
58 * command? 59 * command?
2170 2171
2171 cleanup_vterm(term); 2172 cleanup_vterm(term);
2172 2173
2173 if (term->tl_finish == 'c') 2174 if (term->tl_finish == 'c')
2174 { 2175 {
2176 aco_save_T aco;
2177
2175 /* ++close or term_finish == "close" */ 2178 /* ++close or term_finish == "close" */
2176 ch_log(NULL, "terminal job finished, closing window"); 2179 ch_log(NULL, "terminal job finished, closing window");
2177 curbuf = term->tl_buffer; 2180 aucmd_prepbuf(&aco, term->tl_buffer);
2178 do_bufdel(DOBUF_WIPE, (char_u *)"", 1, fnum, fnum, FALSE); 2181 do_bufdel(DOBUF_WIPE, (char_u *)"", 1, fnum, fnum, FALSE);
2182 aucmd_restbuf(&aco);
2179 break; 2183 break;
2180 } 2184 }
2181 if (term->tl_finish == 'o' && term->tl_buffer->b_nwindows == 0) 2185 if (term->tl_finish == 'o' && term->tl_buffer->b_nwindows == 0)
2182 { 2186 {
2183 char buf[50]; 2187 char buf[50];