feat(ui): use msg_grid based implementation for cmdheight=0

This commit is contained in:
bfredl
2022-09-13 12:56:30 +02:00
parent bf6de51f55
commit 708bd68651
17 changed files with 89 additions and 135 deletions

View File

@@ -896,7 +896,6 @@ int do_record(int c)
{
char_u *p;
static int regname;
static bool changed_cmdheight = false;
yankreg_T *old_y_previous;
int retval;
@@ -907,18 +906,11 @@ int do_record(int c)
retval = FAIL;
} else {
reg_recording = c;
// TODO(bfredl): showmode based messaging is currently missing with cmdheight=0
showmode();
regname = c;
retval = OK;
if (!ui_has_messages()) {
// Enable macro indicator temporarily
set_option_value("ch", 1L, NULL, 0);
update_screen(UPD_VALID);
changed_cmdheight = true;
}
apply_autocmds(EVENT_RECORDINGENTER, NULL, NULL, false, curbuf);
}
} else { // stop recording
@@ -948,7 +940,7 @@ int do_record(int c)
restore_v_event(dict, &save_v_event);
reg_recorded = reg_recording;
reg_recording = 0;
if (ui_has(kUIMessages)) {
if (p_ch == 0 || ui_has(kUIMessages)) {
showmode();
} else {
msg("");
@@ -964,12 +956,6 @@ 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(UPD_CLEAR);
}
}
return retval;
}