diff src/register.c @ 29546:8a243ecfe2dd v9.0.0114

patch 9.0.0114: the command line takes up space even when not used Commit: https://github.com/vim/vim/commit/f39cfb72629f3e7fefaf578a3faa2619cd0654f8 Author: Shougo Matsushita <Shougo.Matsu@gmail.com> Date: Sat Jul 30 16:54:05 2022 +0100 patch 9.0.0114: the command line takes up space even when not used Problem: The command line takes up space even when not used. Solution: Allow for 'cmdheight' to be set to zero. (Shougo Matsushita, closes #10675, closes #940)
author Bram Moolenaar <Bram@vim.org>
date Sat, 30 Jul 2022 18:00:03 +0200
parents 1c688281673d
children d413dccd4f8a
line wrap: on
line diff
--- a/src/register.c
+++ b/src/register.c
@@ -371,6 +371,7 @@ do_record(int c)
 {
     char_u	    *p;
     static int	    regname;
+    static int	    changed_cmdheight = FALSE;
     yankreg_T	    *old_y_previous, *old_y_current;
     int		    retval;
 
@@ -385,6 +386,15 @@ do_record(int c)
 	    showmode();
 	    regname = c;
 	    retval = OK;
+
+	    if (p_ch < 1)
+	    {
+		// Enable macro indicator temporary
+		set_option_value((char_u *)"ch", 1L, NULL, 0);
+		update_screen(VALID);
+
+		changed_cmdheight = TRUE;
+	    }
 	}
     }
     else			    // stop recording
@@ -412,6 +422,13 @@ do_record(int c)
 	    y_previous = old_y_previous;
 	    y_current = old_y_current;
 	}
+
+	if (changed_cmdheight)
+	{
+	    // Restore cmdheight
+	    set_option_value((char_u *)"ch", 0L, NULL, 0);
+	    redraw_all_later(CLEAR);
+	}
     }
     return retval;
 }