mirror of
https://github.com/vim/vim.git
synced 2025-09-23 03:43:49 -04:00
patch 9.0.0321: cannot use the message popup window directly
Problem: Cannot use the message popup window directly. Solution: Add ":echowindow".
This commit is contained in:
14
src/eval.c
14
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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user