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)
e0429681ae
This commit is contained in:
Jan Edmund Lazo 2019-04-03 19:28:12 -04:00
parent 0baf8583ef
commit ca49ae9e36
2 changed files with 14 additions and 1 deletions

View File

@ -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.

View File

@ -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"),