diff options
author | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2019-04-03 19:28:12 -0400 |
---|---|---|
committer | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2019-04-04 19:10:31 -0400 |
commit | ca49ae9e361d2b3daace2c6bb677e1cca78b8e8d (patch) | |
tree | 58000aa2b63a759daf1db1f465c8a2397a76df61 | |
parent | 0baf8583ef5bca01613d4b4b4344f94ab8b6c0cd (diff) | |
download | rneovim-ca49ae9e361d2b3daace2c6bb677e1cca78b8e8d.tar.gz rneovim-ca49ae9e361d2b3daace2c6bb677e1cca78b8e8d.tar.bz2 rneovim-ca49ae9e361d2b3daace2c6bb677e1cca78b8e8d.zip |
vim-patch:8.1.0135: undo message delays screen update for CTRL-O u
Problem: Undo message delays screen update for CTRL-O u.
Solution: Add smsg_attr_keep(). (closes vim/vim#3125)
https://github.com/vim/vim/commit/e0429681aed5448d1c3b8399d152a2b1a05ea6d7
-rw-r--r-- | src/nvim/message.c | 11 | ||||
-rw-r--r-- | src/nvim/undo.c | 4 |
2 files changed, 14 insertions, 1 deletions
diff --git a/src/nvim/message.c b/src/nvim/message.c index 961bce4bf0..f7c248184e 100644 --- a/src/nvim/message.c +++ b/src/nvim/message.c @@ -400,6 +400,17 @@ int smsg_attr(int attr, char *s, ...) return msg_attr((const char *)IObuff, attr); } +int smsg_attr_keep(int attr, char *s, ...) + FUNC_ATTR_PRINTF(2, 3) +{ + va_list arglist; + + va_start(arglist, s); + vim_vsnprintf((char *)IObuff, IOSIZE, s, arglist); + va_end(arglist); + return msg_attr_keep(IObuff, attr, true, false); +} + /* * Remember the last sourcing name/lnum used in an error message, so that it * isn't printed each time when it didn't change. diff --git a/src/nvim/undo.c b/src/nvim/undo.c index df0507ed41..1534a943e9 100644 --- a/src/nvim/undo.c +++ b/src/nvim/undo.c @@ -2452,7 +2452,9 @@ static void u_undo_end( } } - smsg(_("%" PRId64 " %s; %s #%" PRId64 " %s"), + smsg_attr_keep( + 0, + _("%" PRId64 " %s; %s #%" PRId64 " %s"), u_oldcount < 0 ? (int64_t)-u_oldcount : (int64_t)u_oldcount, _(msgstr), did_undo ? _("before") : _("after"), |