cmdheight=0: fix bugs part2 (#19185)

This commit is contained in:
Shougo
2022-07-31 14:13:19 +09:00
committed by GitHub
parent 7f4c50f8c4
commit c1652bdcb5
10 changed files with 42 additions and 20 deletions

View File

@@ -893,6 +893,7 @@ int do_record(int c)
{
char_u *p;
static int regname;
static bool change_cmdheight = false;
yankreg_T *old_y_previous;
int retval;
@@ -906,6 +907,13 @@ 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;
}
apply_autocmds(EVENT_RECORDINGENTER, NULL, NULL, false, curbuf);
}
} else { // stop recording
@@ -928,6 +936,15 @@ 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.
@@ -2789,7 +2806,7 @@ static void op_yank_reg(oparg_T *oap, bool message, yankreg_T *reg, bool append)
xfree(reg->y_array);
}
if (message && (p_ch > 0 || ui_has(kUIMessages))) { // Display message about yank?
if (message) { // Display message about yank?
if (yank_type == kMTCharWise && yanklines == 1) {
yanklines = 0;
}