diff options
author | Yasuhiro Matsumoto <mattn.jp@gmail.com> | 2022-09-02 12:16:21 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2022-09-02 12:16:21 +0100 |
commit | a02a8a4d849906ae100f46f23642b5f7d1bd314e (patch) | |
tree | d5f20000e11bed560f6ff1135860edba4355305f /src/eval.c | |
parent | 6c667bdc9489963102bd6c46b1b73e4d43c034ce (diff) |
patch 9.0.0356: :echowindow sets the in_echowindow flag too earlyv9.0.0356
Problem: :echowindow sets the in_echowindow flag too early.
Solution: Set in_echowindow only when outputting the text. (Yasuhiro
Matsumoto, closes #11033)
Diffstat (limited to 'src/eval.c')
-rw-r--r-- | src/eval.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/src/eval.c b/src/eval.c index f55d9de8ec..2dfe8174ab 100644 --- a/src/eval.c +++ b/src/eval.c @@ -6728,10 +6728,6 @@ ex_execute(exarg_T *eap) long start_lnum = SOURCING_LNUM; ga_init2(&ga, 1, 80); -#ifdef HAS_MESSAGE_WINDOW - if (eap->cmdidx == CMD_echowindow) - start_echowindow(); -#endif if (eap->skip) ++emsg_skip; @@ -6796,11 +6792,21 @@ ex_execute(exarg_T *eap) msg_sb_eol(); } - if (eap->cmdidx == CMD_echomsg || eap->cmdidx == CMD_echowindow) + if (eap->cmdidx == CMD_echomsg) { msg_attr(ga.ga_data, echo_attr); out_flush(); } + else if (eap->cmdidx == CMD_echowindow) + { +#ifdef HAS_MESSAGE_WINDOW + start_echowindow(); +#endif + msg_attr(ga.ga_data, echo_attr); +#ifdef HAS_MESSAGE_WINDOW + end_echowindow(); +#endif + } else if (eap->cmdidx == CMD_echoconsole) { ui_write(ga.ga_data, (int)STRLEN(ga.ga_data), TRUE); @@ -6832,10 +6838,6 @@ ex_execute(exarg_T *eap) if (eap->skip) --emsg_skip; -#ifdef HAS_MESSAGE_WINDOW - if (eap->cmdidx == CMD_echowindow) - end_echowindow(); -#endif set_nextcmd(eap, arg); } |