aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/normal.c
diff options
context:
space:
mode:
authorMatthieu Coudron <mattator@gmail.com>2020-06-06 02:05:49 +0200
committerGitHub <noreply@github.com>2020-06-06 02:05:49 +0200
commit33dafc4f0f21f763dac8f6bdbd27117666f908c5 (patch)
tree179301040b52babddbe60001bc5c9b467edc310a /src/nvim/normal.c
parentfca471d8e2573c2351151051a2d2c6eee0b2243b (diff)
parent9538a7895cb6af2312a39c4c0710ace638309914 (diff)
downloadrneovim-33dafc4f0f21f763dac8f6bdbd27117666f908c5.tar.gz
rneovim-33dafc4f0f21f763dac8f6bdbd27117666f908c5.tar.bz2
rneovim-33dafc4f0f21f763dac8f6bdbd27117666f908c5.zip
Merge pull request #12413 from janlazo/vim-8.2.0089
[RDY]vim-patch:8.0.1564,8.1.{917,1895,2018,2335},8.2.{89,491,873,892,905}
Diffstat (limited to 'src/nvim/normal.c')
-rw-r--r--src/nvim/normal.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/nvim/normal.c b/src/nvim/normal.c
index 87d687198d..968cfde388 100644
--- a/src/nvim/normal.c
+++ b/src/nvim/normal.c
@@ -621,6 +621,8 @@ static void normal_redraw_mode_message(NormalState *s)
update_screen(0);
// now reset it, otherwise it's put in the history again
keep_msg = kmsg;
+
+ kmsg = vim_strsave(keep_msg);
msg_attr((const char *)kmsg, keep_msg_attr);
xfree(kmsg);
}
@@ -1265,10 +1267,15 @@ static void normal_redraw(NormalState *s)
// Display message after redraw. If an external message is still visible,
// it contains the kept message already.
if (keep_msg != NULL && !msg_ext_is_visible()) {
- // msg_attr_keep() will set keep_msg to NULL, must free the string here.
- // Don't reset keep_msg, msg_attr_keep() uses it to check for duplicates.
- char *p = (char *)keep_msg;
- msg_attr(p, keep_msg_attr);
+ char_u *const p = vim_strsave(keep_msg);
+
+ // msg_start() will set keep_msg to NULL, make a copy
+ // first. Don't reset keep_msg, msg_attr_keep() uses it to
+ // check for duplicates. Never put this message in
+ // history.
+ msg_hist_off = true;
+ msg_attr((const char *)p, keep_msg_attr);
+ msg_hist_off = false;
xfree(p);
}