]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.0.2125: File info disappears when 'cmdheight' has decreased v9.0.2125
authorzeertzjq <zeertzjq@outlook.com>
Thu, 23 Nov 2023 19:37:01 +0000 (20:37 +0100)
committerChristian Brabandt <cb@256bit.org>
Thu, 23 Nov 2023 19:37:01 +0000 (20:37 +0100)
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 <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
src/message.c
src/testdir/test_messages.vim
src/version.c

index 83c8b4f4a05fc25a6dee7baa29bb6c10dc84c839..80d6a18b51e34fca9e8d94faf87ee5612d4e5b91 100644 (file)
@@ -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);
index 6db17460b6c6fea77d43a4292b9178185d16b0ea..48f1bab45be8abe8a0d39ab807e822d95776cbcc 100644 (file)
@@ -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
index fc3389888e41f881c3b7bcf0cf98ac9899bdd6f5..801ca36d13e42624c4fcdd7c6dcdabe226578d96 100644 (file)
@@ -704,6 +704,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    2125,
 /**/
     2124,
 /**/