diff src/window.c @ 34110:0c40b031e7d8 v9.1.0019

patch 9.1.0019: cmdline may disappear when changing 'cmdheight' Commit: https://github.com/vim/vim/commit/8610f74382039c9c54d6c4aeb978d252e762360a Author: Christian Brabandt <cb@256bit.org> Date: Fri Jan 12 17:34:40 2024 +0100 patch 9.1.0019: cmdline may disappear when changing 'cmdheight' Problem: cmdline may disappear when changing 'cmdheight' (after Patch 9.0.0190, @markonm) Solution: always re-calculate the old_p_ch value, not only when cmdline_row was higher than expected fixes: #13822 closes: #13826 Signed-off-by: Christian Brabandt <cb@256bit.org>
author Christian Brabandt <cb@256bit.org>
date Fri, 12 Jan 2024 17:45:06 +0100
parents 808cf14bad77
children 27b3a4fe9c5e
line wrap: on
line diff
--- a/src/window.c
+++ b/src/window.c
@@ -7131,17 +7131,17 @@ command_height(void)
 
     // If the space for the command line is already more than 'cmdheight' there
     // is nothing to do (window size must have decreased).
+    // Note: this makes curtab->tp_ch_used unreliable
     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 + 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
+    // old_p_ch may be unreliable, because of the early return above, so
+    // set old_p_ch to what it would be, so that the windows get resized
     // properly for the new value.
-    if (cmdline_row < Rows - p_ch)
-	old_p_ch = Rows - cmdline_row;
+    old_p_ch = Rows - cmdline_row;
 
     // Find bottom frame with width of screen.
     frp = lastwin->w_frame;