patch 9.0.0683: cannot specify a time for :echowindow
Problem: Cannot specify a time for :echowindow.
Solution: A count can be used to specify the display time. Add
popup_findecho().
diff --git a/src/vim9execute.c b/src/vim9execute.c
index df18f9e..c907360 100644
--- a/src/vim9execute.c
+++ b/src/vim9execute.c
@@ -3269,7 +3269,7 @@
case ISN_ECHOCONSOLE:
case ISN_ECHOERR:
{
- int count = iptr->isn_arg.number;
+ int count;
garray_T ga;
char_u buf[NUMBUFLEN];
char_u *p;
@@ -3277,6 +3277,10 @@
int failed = FALSE;
int idx;
+ if (iptr->isn_type == ISN_ECHOWINDOW)
+ count = iptr->isn_arg.echowin.ewin_count;
+ else
+ count = iptr->isn_arg.number;
ga_init2(&ga, 1, 80);
for (idx = 0; idx < count; ++idx)
{
@@ -3339,7 +3343,8 @@
#ifdef HAS_MESSAGE_WINDOW
else if (iptr->isn_type == ISN_ECHOWINDOW)
{
- start_echowindow();
+ start_echowindow(
+ iptr->isn_arg.echowin.ewin_time);
msg_attr(ga.ga_data, echo_attr);
end_echowindow();
}
@@ -6094,8 +6099,13 @@
(varnumber_T)(iptr->isn_arg.number));
break;
case ISN_ECHOWINDOW:
- smsg("%s%4d ECHOWINDOW %lld", pfx, current,
- (varnumber_T)(iptr->isn_arg.number));
+ if (iptr->isn_arg.echowin.ewin_time > 0)
+ smsg("%s%4d ECHOWINDOW %d (%ld sec)", pfx, current,
+ iptr->isn_arg.echowin.ewin_count,
+ iptr->isn_arg.echowin.ewin_time);
+ else
+ smsg("%s%4d ECHOWINDOW %d", pfx, current,
+ iptr->isn_arg.echowin.ewin_count);
break;
case ISN_ECHOCONSOLE:
smsg("%s%4d ECHOCONSOLE %lld", pfx, current,