Mirror of the Vim source from https://github.com/vim/vim
Révision | bfcafd1a3e379999046d8caa65df3414328b2096 (tree) |
---|---|
l'heure | 2020-01-20 00:00:04 |
Auteur | Bram Moolenaar <Bram@vim....> |
Commiter | Bram Moolenaar |
patch 8.2.0131: command line is not cleared when switching tabs
Commit: https://github.com/vim/vim/commit/479950f6c9aee4806f28a2b2fe5471e18a034cff
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Jan 19 15:45:17 2020 +0100
@@ -0,0 +1,10 @@ | ||
1 | +| +8#0000001#e0e0e08|+| |[|N|o| |N|a|m|e|]| | +2#0000000#ffffff0|[|N|o| |N|a|m|e|]| | +1&&@49|X+8#0000001#e0e0e08 | |
2 | +> +0#0000000#ffffff0@74 | |
3 | +|~+0#4040ff13&| @73 | |
4 | +|~| @73 | |
5 | +|~| @73 | |
6 | +|~| @73 | |
7 | +|~| @73 | |
8 | +| +0#0000000&@74 | |
9 | +@75 | |
10 | +@57|0|,|0|-|1| @8|A|l@1| |
@@ -905,4 +905,22 @@ | ||
905 | 905 | delfunc CmdWinType |
906 | 906 | endfunc |
907 | 907 | |
908 | +func Test_cmdlineclear_tabenter() | |
909 | + CheckScreendump | |
910 | + | |
911 | + let lines =<< trim [SCRIPT] | |
912 | + call setline(1, range(30)) | |
913 | + [SCRIPT] | |
914 | + | |
915 | + call writefile(lines, 'XtestCmdlineClearTabenter') | |
916 | + let buf = RunVimInTerminal('-S XtestCmdlineClearTabenter', #{rows: 10}) | |
917 | + call term_wait(buf, 50) | |
918 | + " in one tab make the command line higher with CTRL-W - | |
919 | + call term_sendkeys(buf, ":tabnew\<cr>\<C-w>-\<C-w>-gtgt") | |
920 | + call VerifyScreenDump(buf, 'Test_cmdlineclear_tabenter', {}) | |
921 | + | |
922 | + call StopVimInTerminal(buf) | |
923 | + call delete('XtestCmdlineClearTabenter') | |
924 | +endfunc | |
925 | + | |
908 | 926 | " vim: shiftwidth=2 sts=2 expandtab |
@@ -743,6 +743,8 @@ | ||
743 | 743 | static int included_patches[] = |
744 | 744 | { /* Add new patch number below this line */ |
745 | 745 | /**/ |
746 | + 131, | |
747 | +/**/ | |
746 | 748 | 130, |
747 | 749 | /**/ |
748 | 750 | 129, |
@@ -4093,6 +4093,7 @@ | ||
4093 | 4093 | int trigger_enter_autocmds, |
4094 | 4094 | int trigger_leave_autocmds) |
4095 | 4095 | { |
4096 | + int row; | |
4096 | 4097 | int old_off = tp->tp_firstwin->w_winrow; |
4097 | 4098 | win_T *next_prevwin = tp->tp_prevwin; |
4098 | 4099 |
@@ -4109,7 +4110,7 @@ | ||
4109 | 4110 | prevwin = next_prevwin; |
4110 | 4111 | |
4111 | 4112 | last_status(FALSE); // status line may appear or disappear |
4112 | - (void)win_comp_pos(); // recompute w_winrow for all windows | |
4113 | + row = win_comp_pos(); // recompute w_winrow for all windows | |
4113 | 4114 | #ifdef FEAT_DIFF |
4114 | 4115 | diff_need_scrollbind = TRUE; |
4115 | 4116 | #endif |
@@ -4121,6 +4122,13 @@ | ||
4121 | 4122 | if (p_ch != curtab->tp_ch_used) |
4122 | 4123 | clear_cmdline = TRUE; |
4123 | 4124 | p_ch = curtab->tp_ch_used; |
4125 | + | |
4126 | + // When cmdheight is changed in a tab page with '<C-w>-', cmdline_row is | |
4127 | + // changed but p_ch and tp_ch_used are not changed. Thus we also need to | |
4128 | + // check cmdline_row. | |
4129 | + if ((row < cmdline_row) && (cmdline_row <= Rows - p_ch)) | |
4130 | + clear_cmdline = TRUE; | |
4131 | + | |
4124 | 4132 | if (curtab->tp_old_Rows != Rows || (old_off != firstwin->w_winrow |
4125 | 4133 | #ifdef FEAT_GUI_TABLINE |
4126 | 4134 | && !gui_use_tabline() |