aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJosh Rahm <rahm@google.com>2022-08-10 17:13:52 -0600
committerJosh Rahm <rahm@google.com>2022-08-10 17:13:52 -0600
commit234128e54154932d194f0ca3d09c86c9b756c390 (patch)
tree6bbc51b03b7e9b7f89c4fa5670fe3062dab56d4f
parent201315a739c7d184004ec8a09a998fbe0bee56bd (diff)
downloadrneovim-234128e54154932d194f0ca3d09c86c9b756c390.tar.gz
rneovim-234128e54154932d194f0ca3d09c86c9b756c390.tar.bz2
rneovim-234128e54154932d194f0ca3d09c86c9b756c390.zip
Fix messaging for recording into userregs.
-rw-r--r--src/nvim/ops.c2
-rw-r--r--src/nvim/screen.c8
2 files changed, 7 insertions, 3 deletions
diff --git a/src/nvim/ops.c b/src/nvim/ops.c
index e4b582c89b..d18824f0c1 100644
--- a/src/nvim/ops.c
+++ b/src/nvim/ops.c
@@ -1096,7 +1096,7 @@ int do_record(int c)
// Name of requested register, or empty string for unnamed operation.
char buf[NUMBUFLEN + 5];
int len = (*utf_char2len)(regname);
- buf[0] = (char)regname;
+ utf_char2bytes(regname, buf);
buf[len] = NUL;
(void)tv_dict_add_str(dict, S_LEN("regname"), buf);
tv_dict_set_keys_readonly(dict);
diff --git a/src/nvim/screen.c b/src/nvim/screen.c
index 0b7b58dc40..6f4400e531 100644
--- a/src/nvim/screen.c
+++ b/src/nvim/screen.c
@@ -6216,8 +6216,12 @@ static void recording_mode(int attr)
{
msg_puts_attr(_("recording"), attr);
if (!shortmess(SHM_RECORDING)) {
- char s[4];
- snprintf(s, ARRAY_SIZE(s), " @%c", reg_recording);
+ char s[10];
+ int len = (*utf_char2len)(reg_recording);
+ utf_char2bytes(reg_recording, s + 2);
+ s[0] = ' ';
+ s[1] = '@';
+ s[len + 2] = 0;
msg_puts_attr(s, attr);
}
}