# HG changeset patch # User Christian Brabandt # Date 1700768705 -3600 # Node ID f0ba42bd97839b0d80b5ddd8402c4d9448a8fee9 # Parent de9eb7b493c900d8acdc9818ac3a3a997bb56dcd patch 9.0.2125: File info disappears when 'cmdheight' has decreased Commit: https://github.com/vim/vim/commit/40ed6711bd385051021691980e8ce16375b4b510 Author: zeertzjq Date: Thu Nov 23 20:37:01 2023 +0100 patch 9.0.2125: File info disappears when 'cmdheight' has decreased Problem: File info disappears immediately when 'cmdheight' has just decreased due to switching tabpage and 'shortmess' doesn't contain 'o' or 'O'. Solution: Make sure msg_row isn't smaller than cmdline_row. fixes: #13560 closes: #13561 Signed-off-by: zeertzjq Signed-off-by: Christian Brabandt diff --git a/src/message.c b/src/message.c --- a/src/message.c +++ b/src/message.c @@ -1446,6 +1446,9 @@ msg_start(void) { int did_return = FALSE; + if (msg_row < cmdline_row) + msg_row = cmdline_row; + if (!msg_silent) { VIM_CLEAR(keep_msg); diff --git a/src/testdir/test_messages.vim b/src/testdir/test_messages.vim --- a/src/testdir/test_messages.vim +++ b/src/testdir/test_messages.vim @@ -478,6 +478,29 @@ func Test_echo_string_partial() call assert_equal("function('CountSpaces', [{'ccccccccccc': ['ab', 'cd'], 'aaaaaaaaaaa': v:false, 'bbbbbbbbbbbb': ''}])", string(function('CountSpaces', [#{aaaaaaaaaaa: v:false, bbbbbbbbbbbb: '', ccccccccccc: ['ab', 'cd']}]))) endfunc +" Test that fileinfo is shown properly when 'cmdheight' has just decreased +" due to switching tabpage and 'shortmess' doesn't contain 'o' or 'O'. +func Test_fileinfo_tabpage_cmdheight() + CheckRunVimInTerminal + + let content =<< trim END + set shortmess-=o + set shortmess-=O + set shortmess-=F + tabnew + set cmdheight=2 + tabprev + edit Xfileinfo.txt + END + + call writefile(content, 'Xtest_fileinfo_tabpage_cmdheight', 'D') + let buf = RunVimInTerminal('-S Xtest_fileinfo_tabpage_cmdheight', #{rows: 6}) + call WaitForAssert({-> assert_match('^"Xfileinfo.txt" \[New\]', term_getline(buf, 6))}) + + " clean up + call StopVimInTerminal(buf) +endfunc + " Message output was previously overwritten by the fileinfo display, shown " when switching buffers. If a buffer is switched to, then a message if " echoed, we should show the message, rather than overwriting it with diff --git a/src/version.c b/src/version.c --- a/src/version.c +++ b/src/version.c @@ -705,6 +705,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 2125, +/**/ 2124, /**/ 2123,