diff options
author | Bram Moolenaar <Bram@vim.org> | 2022-08-29 18:16:32 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2022-08-29 18:16:32 +0100 |
commit | 37fef16c225eabed28a3c7a0542d2eeef30d812b (patch) | |
tree | 57bebcbc858d18cb593d625d7eb659eb8f3a3c7a /src/eval.c | |
parent | 54acb90d9e672315e3bd13f8dc71f828df97c868 (diff) |
patch 9.0.0321: cannot use the message popup window directlyv9.0.0321
Problem: Cannot use the message popup window directly.
Solution: Add ":echowindow".
Diffstat (limited to 'src/eval.c')
-rw-r--r-- | src/eval.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/eval.c b/src/eval.c index 8cd2716406..cc2e1ffcf5 100644 --- a/src/eval.c +++ b/src/eval.c @@ -2078,7 +2078,8 @@ set_context_for_expression( if ((cmdidx == CMD_execute || cmdidx == CMD_echo || cmdidx == CMD_echon - || cmdidx == CMD_echomsg) + || cmdidx == CMD_echomsg + || cmdidx == CMD_echowindow) && xp->xp_context == EXPAND_EXPRESSION) { for (;;) @@ -6709,6 +6710,7 @@ get_echo_attr(void) /* * ":execute expr1 ..." execute the result of an expression. * ":echomsg expr1 ..." Print a message + * ":echowindow expr1 ..." Print a message in the messages window * ":echoerr expr1 ..." Print an error * ":echoconsole expr1 ..." Print a message on stdout * Each gets spaces around each argument and a newline at the end for @@ -6726,6 +6728,9 @@ ex_execute(exarg_T *eap) long start_lnum = SOURCING_LNUM; ga_init2(&ga, 1, 80); +#ifdef HAS_MESSAGE_WINDOW + in_echowindow = (eap->cmdidx == CMD_echowindow); +#endif if (eap->skip) ++emsg_skip; @@ -6780,7 +6785,9 @@ ex_execute(exarg_T *eap) // use the first line of continuation lines for messages SOURCING_LNUM = start_lnum; - if (eap->cmdidx == CMD_echomsg || eap->cmdidx == CMD_echoerr) + if (eap->cmdidx == CMD_echomsg + || eap->cmdidx == CMD_echowindow + || eap->cmdidx == CMD_echoerr) { // Mark the already saved text as finishing the line, so that what // follows is displayed on a new line when scrolling back at the @@ -6788,7 +6795,7 @@ ex_execute(exarg_T *eap) msg_sb_eol(); } - if (eap->cmdidx == CMD_echomsg) + if (eap->cmdidx == CMD_echomsg || eap->cmdidx == CMD_echowindow) { msg_attr(ga.ga_data, echo_attr); out_flush(); @@ -6835,6 +6842,7 @@ ex_execute(exarg_T *eap) if (msg_col == 0) msg_col = 1; } + in_echowindow = FALSE; #endif set_nextcmd(eap, arg); } |