comparison src/terminal.c @ 13380:69517d67421f v8.0.1564

patch 8.0.1564: too many #ifdefs commit https://github.com/vim/vim/commit/f2bd8ef2b4507d02c6043affff8f7e85e3414d5f Author: Bram Moolenaar <Bram@vim.org> Date: Sun Mar 4 18:08:14 2018 +0100 patch 8.0.1564: too many #ifdefs Problem: Too many #ifdefs. Solution: Graduate the +autocmd feature. Takes away 450 #ifdefs and increases code size of tiny Vim by only 40 Kbyte.
author Christian Brabandt <cb@256bit.org>
date Sun, 04 Mar 2018 18:15:08 +0100
parents 68c4fc9ae216
children fa198b71bab2
comparison
equal deleted inserted replaced
13379:0f9dd1b43244 13380:69517d67421f
36 * that buffer, attributes come from the scrollback buffer tl_scrollback. 36 * that buffer, attributes come from the scrollback buffer tl_scrollback.
37 * When the buffer is changed it is turned into a normal buffer, the attributes 37 * When the buffer is changed it is turned into a normal buffer, the attributes
38 * in tl_scrollback are no longer used. 38 * in tl_scrollback are no longer used.
39 * 39 *
40 * TODO: 40 * TODO:
41 * - What to store in a session file? Shell at the prompt would be OK to
42 * restore, but others may not. Open the window and let the user start the
43 * command? Also see #2650.
44 * - Adding WinBar to terminal window doesn't display, text isn't shifted down.
41 * - When using 'termguicolors' still use the 16 ANSI colors as-is. Helps for 45 * - When using 'termguicolors' still use the 16 ANSI colors as-is. Helps for
42 * a job that uses 16 colors while Vim is using > 256. 46 * a job that uses 16 colors while Vim is using > 256.
43 * - in GUI vertical split causes problems. Cursor is flickering. (Hirohito 47 * - in GUI vertical split causes problems. Cursor is flickering. (Hirohito
44 * Higashi, 2017 Sep 19) 48 * Higashi, 2017 Sep 19)
45 * - Trigger TerminalOpen event? #2422 patch in #2484 49 * - Trigger TerminalOpen event? #2422 patch in #2484
46 * - after resizing windows overlap. (Boris Staletic, #2164) 50 * - after resizing windows overlap. (Boris Staletic, #2164)
47 * - Redirecting output does not work on MS-Windows, Test_terminal_redir_file() 51 * - Redirecting output does not work on MS-Windows, Test_terminal_redir_file()
48 * is disabled. 52 * is disabled.
53 * - if the job in the terminal does not support the mouse, we can use the
54 * mouse in the Terminal window for copy/paste and scrolling.
49 * - cursor blinks in terminal on widows with a timer. (xtal8, #2142) 55 * - cursor blinks in terminal on widows with a timer. (xtal8, #2142)
50 * - What to store in a session file? Shell at the prompt would be OK to
51 * restore, but others may not. Open the window and let the user start the
52 * command? Also see #2650.
53 * - When closing gvim with an active terminal buffer, the dialog suggests 56 * - When closing gvim with an active terminal buffer, the dialog suggests
54 * saving the buffer. Should say something else. (Manas Thakur, #2215) 57 * saving the buffer. Should say something else. (Manas Thakur, #2215)
55 * Also: #2223 58 * Also: #2223
56 * - Termdebug does not work when Vim build with mzscheme. gdb hangs. 59 * - Termdebug does not work when Vim build with mzscheme. gdb hangs.
57 * - MS-Windows GUI: WinBar has tearoff item 60 * - MS-Windows GUI: WinBar has tearoff item
58 * - Adding WinBar to terminal window doesn't display, text isn't shifted down.
59 * - MS-Windows GUI: still need to type a key after shell exits? #1924 61 * - MS-Windows GUI: still need to type a key after shell exits? #1924
60 * - After executing a shell command the status line isn't redraw. 62 * - After executing a shell command the status line isn't redraw.
61 * - implement term_setsize() 63 * - implement term_setsize()
62 * - add test for giving error for invalid 'termsize' value. 64 * - add test for giving error for invalid 'termsize' value.
63 * - support minimal size when 'termsize' is "rows*cols". 65 * - support minimal size when 'termsize' is "rows*cols".
64 * - support minimal size when 'termsize' is empty? 66 * - support minimal size when 'termsize' is empty?
65 * - if the job in the terminal does not support the mouse, we can use the
66 * mouse in the Terminal window for copy/paste and scrolling.
67 * - GUI: when using tabs, focus in terminal, click on tab does not work. 67 * - GUI: when using tabs, focus in terminal, click on tab does not work.
68 * - GUI: when 'confirm' is set and trying to exit Vim, dialog offers to save 68 * - GUI: when 'confirm' is set and trying to exit Vim, dialog offers to save
69 * changes to "!shell". 69 * changes to "!shell".
70 * (justrajdeep, 2017 Aug 22) 70 * (justrajdeep, 2017 Aug 22)
71 * - Redrawing is slow with Athena and Motif. Also other GUI? (Ramel Eshed) 71 * - Redrawing is slow with Athena and Motif. Also other GUI? (Ramel Eshed)
504 504
505 /* Make sure we don't get stuck on sending keys to the job, it leads to 505 /* Make sure we don't get stuck on sending keys to the job, it leads to
506 * a deadlock if the job is waiting for Vim to read. */ 506 * a deadlock if the job is waiting for Vim to read. */
507 channel_set_nonblock(term->tl_job->jv_channel, PART_IN); 507 channel_set_nonblock(term->tl_job->jv_channel, PART_IN);
508 508
509 #ifdef FEAT_AUTOCMD
510 if (!opt->jo_hidden) 509 if (!opt->jo_hidden)
511 { 510 {
512 ++curbuf->b_locked; 511 ++curbuf->b_locked;
513 apply_autocmds(EVENT_BUFWINENTER, NULL, NULL, FALSE, curbuf); 512 apply_autocmds(EVENT_BUFWINENTER, NULL, NULL, FALSE, curbuf);
514 --curbuf->b_locked; 513 --curbuf->b_locked;
515 } 514 }
516 #endif
517 515
518 if (old_curbuf != NULL) 516 if (old_curbuf != NULL)
519 { 517 {
520 --curbuf->b_nwindows; 518 --curbuf->b_nwindows;
521 curbuf = old_curbuf; 519 curbuf = old_curbuf;
936 case K_F21: key = VTERM_KEY_FUNCTION(21); break; 934 case K_F21: key = VTERM_KEY_FUNCTION(21); break;
937 #endif 935 #endif
938 #ifdef FEAT_DND 936 #ifdef FEAT_DND
939 case K_DROP: return 0; 937 case K_DROP: return 0;
940 #endif 938 #endif
941 #ifdef FEAT_AUTOCMD
942 case K_CURSORHOLD: return 0; 939 case K_CURSORHOLD: return 0;
943 #endif
944 case K_PS: vterm_keyboard_start_paste(vterm); 940 case K_PS: vterm_keyboard_start_paste(vterm);
945 other = TRUE; 941 other = TRUE;
946 break; 942 break;
947 case K_PE: vterm_keyboard_end_paste(vterm); 943 case K_PE: vterm_keyboard_end_paste(vterm);
948 other = TRUE; 944 other = TRUE;