Patch 9.0.0665
Problem: Setting 'cmdheight' has no effect if last window was resized.
Solution: Do apply 'cmdheight' when told to. Use the frame height instead
of the cmdline_row. (closes #11286)
Files: src/option.c, src/window.c, src/testdir/test_cmdline.vim,
src/testdir/dumps/Test_changing_cmdheight_6.dump
*** ../vim-9.0.0664/src/option.c 2022-10-04 16:23:39.018042176 +0100
--- src/option.c 2022-10-05 15:41:29.174143643 +0100
***************
*** 3577,3587 ****
// Only compute the new window layout when startup has been
// completed. Otherwise the frame sizes may be wrong.
! if (p_ch != old_value && full_screen
#ifdef FEAT_GUI
&& !gui.starting
#endif
! )
command_height();
}
--- 3577,3588 ----
// 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
#ifdef FEAT_GUI
&& !gui.starting
#endif
! )
command_height();
}
*** ../vim-9.0.0664/src/window.c 2022-10-04 16:23:39.022042174 +0100
--- src/window.c 2022-10-05 15:39:06.530506184 +0100
***************
*** 6644,6650 ****
}
/*
! * command_height: called whenever p_ch has been changed
*/
void
command_height(void)
--- 6644,6650 ----
}
/*
! * Command_height: called whenever p_ch has been changed.
*/
void
command_height(void)
***************
*** 6663,6668 ****
--- 6663,6671 ----
if (p_ch > old_p_ch && cmdline_row <= Rows - p_ch)
return;
+ // Update cmdline_row to what it should be: just below the last window.
+ cmdline_row = topframe->fr_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
// properly for the new value.
*** ../vim-9.0.0664/src/testdir/test_cmdline.vim 2022-09-20
17:11:43.589765767 +0100
--- src/testdir/test_cmdline.vim 2022-10-05 15:33:43.403332071 +0100
***************
*** 248,253 ****
--- 248,260 ----
let lines =<< trim END
set cmdheight=1 laststatus=2
+ func EchoTwo()
+ set laststatus=2
+ set cmdheight=5
+ echo 'foo'
+ echo 'bar'
+ set cmdheight=1
+ endfunc
END
call writefile(lines, 'XTest_cmdheight', 'D')
***************
*** 272,277 ****
--- 279,288 ----
call term_sendkeys(buf, ":set cmdheight=1\<CR>")
call VerifyScreenDump(buf, 'Test_changing_cmdheight_5', {})
+ " setting 'cmdheight' works after outputting two messages
+ call term_sendkeys(buf, ":call EchoTwo()\<CR>")
+ call VerifyScreenDump(buf, 'Test_changing_cmdheight_6', {})
+
" clean up
call StopVimInTerminal(buf)
endfunc
*** ../vim-9.0.0664/src/testdir/dumps/Test_changing_cmdheight_6.dump
2022-10-05 15:39:22.018466779 +0100
--- src/testdir/dumps/Test_changing_cmdheight_6.dump 2022-10-05
15:33:48.659318570 +0100
***************
*** 0 ****
--- 1,8 ----
+ > +0&#ffffff0@74
+ |~+0#4040ff13&| @73
+ |~| @73
+ |~| @73
+ |~| @73
+ |~| @73
+ |[+3#0000000&|N|o| |N|a|m|e|]| @47|0|,|0|-|1| @9|A|l@1
+ | +0&&@74
*** ../vim-9.0.0664/src/version.c 2022-10-05 13:28:53.957039865 +0100
--- src/version.c 2022-10-05 15:38:28.410603257 +0100
***************
*** 701,702 ****
--- 701,704 ----
{ /* Add new patch number below this line */
+ /**/
+ 665,
/**/
--
The greatest lies of all time:
(1) The check is in the mail.
(2) We have a really challenging assignment for you.
(3) I love you.
(4) All bugs have been fixed.
(5) This won't hurt a bit.
(6) Honey, I just need to debug this program and be home in 5 minutes.
(7) I have just sent you an e-mail about that.
(8) Of course I'll respect you in the morning.
(9) I'm from the government, and I'm here to help you.
/// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/vim_dev/20221005144312.B767B1C0475%40moolenaar.net.