diff options
author | zeertzjq <zeertzjq@outlook.com> | 2022-10-06 20:03:59 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-06 20:03:59 +0800 |
commit | 25dea99ce54de6a8c4369e28e0db82e1af669f24 (patch) | |
tree | 0b459d5b835bafb8f8d615deca779734eaa028d0 /src | |
parent | 2c08ab5369c79afd9138c38164e2d2c157ce8435 (diff) | |
download | rneovim-25dea99ce54de6a8c4369e28e0db82e1af669f24.tar.gz rneovim-25dea99ce54de6a8c4369e28e0db82e1af669f24.tar.bz2 rneovim-25dea99ce54de6a8c4369e28e0db82e1af669f24.zip |
vim-patch:9.0.0670: no space for command line when there is a tabline (#20512)
Problem: No space for command line when there is a tabline.
Solution: Correct computation of where the command line should be.
(closes vim/vim#11295)
https://github.com/vim/vim/commit/c9f5f73206272ccad0aa536854debc5f9781978a
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/option.c | 4 | ||||
-rw-r--r-- | src/nvim/testdir/test_cmdline.vim | 10 | ||||
-rw-r--r-- | src/nvim/window.c | 4 |
3 files changed, 15 insertions, 3 deletions
diff --git a/src/nvim/option.c b/src/nvim/option.c index a2dd2e7d84..c6a9d6b7db 100644 --- a/src/nvim/option.c +++ b/src/nvim/option.c @@ -2468,7 +2468,9 @@ static char *set_num_option(int opt_idx, char_u *varp, long value, char *errbuf, // if p_ch changed value, change the command line height // Only compute the new window layout when startup has been // completed. Otherwise the frame sizes may be wrong. - if ((p_ch != old_value || topframe->fr_height != Rows - p_ch) && full_screen) { + if ((p_ch != old_value + || tabline_height() + topframe->fr_height != Rows - p_ch) + && full_screen) { command_height(); } } else if (pp == &p_uc) { diff --git a/src/nvim/testdir/test_cmdline.vim b/src/nvim/testdir/test_cmdline.vim index b177a9cc9e..3f8e141afa 100644 --- a/src/nvim/testdir/test_cmdline.vim +++ b/src/nvim/testdir/test_cmdline.vim @@ -225,6 +225,16 @@ func Test_changing_cmdheight() call StopVimInTerminal(buf) endfunc +func Test_cmdheight_tabline() + CheckScreendump + + let buf = RunVimInTerminal('-c "set ls=2" -c "set stal=2" -c "set cmdheight=1"', {'rows': 6}) + call VerifyScreenDump(buf, 'Test_cmdheight_tabline_1', {}) + + " clean up + call StopVimInTerminal(buf) +endfunc + func Test_map_completion() if !has('cmdline_compl') return diff --git a/src/nvim/window.c b/src/nvim/window.c index ecd713013f..5993df64cd 100644 --- a/src/nvim/window.c +++ b/src/nvim/window.c @@ -4300,7 +4300,7 @@ static void enter_tabpage(tabpage_T *tp, buf_T *old_curbuf, bool trigger_enter_a // When cmdheight is changed in a tab page with '<C-w>-', cmdline_row is // changed but p_ch and tp_ch_used are not changed. Thus we also need to // check cmdline_row. - if ((row < cmdline_row) && (cmdline_row <= Rows - p_ch)) { + if (row < cmdline_row && cmdline_row <= Rows - p_ch) { clear_cmdline = true; } @@ -6409,7 +6409,7 @@ void command_height(void) curtab->tp_ch_used = p_ch; // Update cmdline_row to what it should be: just below the last window. - cmdline_row = topframe->fr_height; + cmdline_row = topframe->fr_height + tabline_height(); // If cmdline_row is smaller than what it is supposed to be for 'cmdheight' // then set old_p_ch to what it would be, so that the windows get resized |