vim-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 vim/vim#10675, closes vim/vim#940)
f39cfb7262

Omit win_redr_ruler() change: winbar may still need redraw.
Omit win_update() changes: Nvim doesn't use `Rows` there.
Omit redraw_asap(): removed.
This commit is contained in:
Shougo Matsushita
2022-07-31 17:06:32 +09:00
committed by zeertzjq
parent abc087f4c6
commit 81a1d26c3e
9 changed files with 68 additions and 26 deletions

View File

@@ -893,7 +893,7 @@ int do_record(int c)
{
char_u *p;
static int regname;
static bool change_cmdheight = false;
static bool changed_cmdheight = false;
yankreg_T *old_y_previous;
int retval;
@@ -907,13 +907,15 @@ int do_record(int c)
showmode();
regname = c;
retval = OK;
if (!ui_has_messages()) {
// Enable macro indicator temporary
set_option_value("ch", 1L, NULL, 0);
update_screen(VALID);
change_cmdheight = true;
changed_cmdheight = true;
}
apply_autocmds(EVENT_RECORDINGENTER, NULL, NULL, false, curbuf);
}
} else { // stop recording
@@ -936,15 +938,6 @@ int do_record(int c)
(void)tv_dict_add_str(dict, S_LEN("regname"), buf);
tv_dict_set_keys_readonly(dict);
if (change_cmdheight) {
// Restore cmdheight
set_option_value("ch", 0L, NULL, 0);
redraw_all_later(CLEAR);
change_cmdheight = false;
}
// Get the recorded key hits. K_SPECIAL will be escaped, this
// needs to be removed again to put it in a register. exec_reg then
// adds the escaping back later.
@@ -968,6 +961,12 @@ int do_record(int c)
y_previous = old_y_previous;
}
if (changed_cmdheight) {
// Restore cmdheight
set_option_value("ch", 0L, NULL, 0);
redraw_all_later(CLEAR);
}
}
return retval;
}