aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/ops.c
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-07-31 19:13:45 +0800
committerGitHub <noreply@github.com>2022-07-31 19:13:45 +0800
commit380417c1ddbd90b084ed27f321b575de34998a9b (patch)
tree99171207e25340bc6bb1b3466f5c192d50d03a4f /src/nvim/ops.c
parentabc087f4c65ca547cae58518b42aee82ff4a07f6 (diff)
parent2c522854c78d4e02d7337cf0b06174387f7f4583 (diff)
downloadrneovim-380417c1ddbd90b084ed27f321b575de34998a9b.tar.gz
rneovim-380417c1ddbd90b084ed27f321b575de34998a9b.tar.bz2
rneovim-380417c1ddbd90b084ed27f321b575de34998a9b.zip
Merge pull request #19587 from Shougo/vim-9.0.0114
vim-patch:9.0.{0114,0115,0118}
Diffstat (limited to 'src/nvim/ops.c')
-rw-r--r--src/nvim/ops.c23
1 files changed, 11 insertions, 12 deletions
diff --git a/src/nvim/ops.c b/src/nvim/ops.c
index 75ba8dbede..0825f17ccc 100644
--- a/src/nvim/ops.c
+++ b/src/nvim/ops.c
@@ -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
+ // Enable macro indicator temporarily
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;
}