Skip to content

Commit f4deb2e

Browse files
committed
Merge remote-tracking branch 'vim/master'
2 parents d31ec94 + 816736b commit f4deb2e

60 files changed

Lines changed: 935 additions & 762 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

runtime/doc/eval.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3833,6 +3833,16 @@ text...
38333833
:echomsg "It's a Zizzer Zazzer Zuzz, as you can plainly see."
38343834
< See |:echo-redraw| to avoid the message disappearing
38353835
when the screen is redrawn.
3836+
3837+
*:echow* *:echowin* *:echowindow*
3838+
:echow[indow] {expr1} ..
3839+
Like |:echomsg| but when the messages popup window is
3840+
available the message is displayed there. This means
3841+
it will show for three seconds and avoid a
3842+
|hit-enter| prompt.
3843+
The message window is available when Vim was compiled
3844+
with the +timer and the +popupwin features.
3845+
38363846
*:echoe* *:echoerr*
38373847
:echoe[rr] {expr1} .. Echo the expression(s) as an error message, saving the
38383848
message in the |message-history|. When used in a

runtime/filetype.vim

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -696,7 +696,10 @@ au BufNewFile,BufRead *.mo,*.gdmo setf gdmo
696696
au BufNewFile,BufRead *.gd setf gdscript
697697

698698
" Godot resource
699-
au BufRead,BufNewFile *.tscn,*.tres setf gdresource
699+
au BufRead,BufNewFile *.tscn,*.tres setf gdresource
700+
701+
" Godot shader
702+
au BufRead,BufNewFile *.gdshader,*.shader setf gdshader
700703

701704
" Gedcom
702705
au BufNewFile,BufRead *.ged,lltxxxxx.txt setf gedcom
@@ -2091,6 +2094,11 @@ au BufNewFile,BufRead */.config/upstart/*.override setf upstart
20912094
" Vala
20922095
au BufNewFile,BufRead *.vala setf vala
20932096

2097+
" VDM
2098+
au BufRead,BufNewFile *.vdmpp,*.vpp setf vdmpp
2099+
au BufRead,BufNewFile *.vdmrt setf vdmrt
2100+
au BufRead,BufNewFile *.vdmsl,*.vdm setf vdmsl
2101+
20942102
" Vera
20952103
au BufNewFile,BufRead *.vr,*.vri,*.vrh setf vera
20962104

src/drawscreen.c

Lines changed: 50 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -170,38 +170,47 @@ update_screen(int type_arg)
170170
if (msg_scrolled)
171171
{
172172
clear_cmdline = TRUE;
173-
if (msg_scrolled > Rows - 5) // clearing is faster
174-
type = UPD_CLEAR;
175-
else if (type != UPD_CLEAR)
173+
if (type != UPD_CLEAR)
176174
{
177-
check_for_delay(FALSE);
178-
if (screen_ins_lines(0, 0, msg_scrolled, (int)Rows, 0, NULL)
179-
== FAIL)
180-
type = UPD_CLEAR;
181-
FOR_ALL_WINDOWS(wp)
175+
if (msg_scrolled > Rows - 5) // redrawing is faster
176+
{
177+
type = UPD_NOT_VALID;
178+
redraw_as_cleared();
179+
}
180+
else
182181
{
183-
if (wp->w_winrow < msg_scrolled)
182+
check_for_delay(FALSE);
183+
if (screen_ins_lines(0, 0, msg_scrolled, (int)Rows, 0, NULL)
184+
== FAIL)
184185
{
185-
if (W_WINROW(wp) + wp->w_height > msg_scrolled
186-
&& wp->w_redr_type < UPD_REDRAW_TOP
187-
&& wp->w_lines_valid > 0
188-
&& wp->w_topline == wp->w_lines[0].wl_lnum)
189-
{
190-
wp->w_upd_rows = msg_scrolled - W_WINROW(wp);
191-
wp->w_redr_type = UPD_REDRAW_TOP;
192-
}
193-
else
186+
type = UPD_NOT_VALID;
187+
redraw_as_cleared();
188+
}
189+
FOR_ALL_WINDOWS(wp)
190+
{
191+
if (wp->w_winrow < msg_scrolled)
194192
{
195-
wp->w_redr_type = UPD_NOT_VALID;
196-
if (W_WINROW(wp) + wp->w_height + wp->w_status_height
197-
<= msg_scrolled)
198-
wp->w_redr_status = TRUE;
193+
if (W_WINROW(wp) + wp->w_height > msg_scrolled
194+
&& wp->w_redr_type < UPD_REDRAW_TOP
195+
&& wp->w_lines_valid > 0
196+
&& wp->w_topline == wp->w_lines[0].wl_lnum)
197+
{
198+
wp->w_upd_rows = msg_scrolled - W_WINROW(wp);
199+
wp->w_redr_type = UPD_REDRAW_TOP;
200+
}
201+
else
202+
{
203+
wp->w_redr_type = UPD_NOT_VALID;
204+
if (W_WINROW(wp) + wp->w_height
205+
+ wp->w_status_height <= msg_scrolled)
206+
wp->w_redr_status = TRUE;
207+
}
199208
}
200209
}
210+
if (!no_update)
211+
redraw_cmdline = TRUE;
212+
redraw_tabline = TRUE;
201213
}
202-
if (!no_update)
203-
redraw_cmdline = TRUE;
204-
redraw_tabline = TRUE;
205214
}
206215
msg_scrolled = 0;
207216
need_wait_return = FALSE;
@@ -1921,24 +1930,9 @@ win_update(win_T *wp)
19211930
}
19221931
}
19231932

1924-
// When starting redraw in the first line, redraw all lines. When
1925-
// there is only one window it's probably faster to clear the screen
1926-
// first.
1933+
// When starting redraw in the first line, redraw all lines.
19271934
if (mid_start == 0)
1928-
{
19291935
mid_end = wp->w_height;
1930-
if (ONE_WINDOW && !WIN_IS_POPUP(wp))
1931-
{
1932-
// Clear the screen when it was not done by win_del_lines() or
1933-
// win_ins_lines() above, "screen_cleared" is FALSE or MAYBE
1934-
// then.
1935-
if (screen_cleared != TRUE)
1936-
screenclear();
1937-
// The screen was cleared, redraw the tab pages line.
1938-
if (redraw_tabline)
1939-
draw_tabline();
1940-
}
1941-
}
19421936

19431937
// When win_del_lines() or win_ins_lines() caused the screen to be
19441938
// cleared (only happens for the first window) or when screenclear()
@@ -3178,7 +3172,7 @@ redraw_later_clear(void)
31783172
}
31793173

31803174
/*
3181-
* Mark all windows to be redrawn later.
3175+
* Mark all windows to be redrawn later. Except popup windows.
31823176
*/
31833177
void
31843178
redraw_all_later(int type)
@@ -3191,6 +3185,20 @@ redraw_all_later(int type)
31913185
set_must_redraw(type);
31923186
}
31933187

3188+
#if 0 // not actually used yet, it probably should
3189+
/*
3190+
* Mark all windows, including popup windows, to be redrawn.
3191+
*/
3192+
void
3193+
redraw_all_windows_later(int type)
3194+
{
3195+
redraw_all_later(type);
3196+
#ifdef FEAT_PROP_POPUP
3197+
popup_redraw_all(); // redraw all popup windows
3198+
#endif
3199+
}
3200+
#endif
3201+
31943202
/*
31953203
* Set "must_redraw" to "type" unless it already has a higher value
31963204
* or it is currently not allowed.

src/eval.c

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2078,7 +2078,8 @@ set_context_for_expression(
20782078
if ((cmdidx == CMD_execute
20792079
|| cmdidx == CMD_echo
20802080
|| cmdidx == CMD_echon
2081-
|| cmdidx == CMD_echomsg)
2081+
|| cmdidx == CMD_echomsg
2082+
|| cmdidx == CMD_echowindow)
20822083
&& xp->xp_context == EXPAND_EXPRESSION)
20832084
{
20842085
for (;;)
@@ -6709,6 +6710,7 @@ get_echo_attr(void)
67096710
/*
67106711
* ":execute expr1 ..." execute the result of an expression.
67116712
* ":echomsg expr1 ..." Print a message
6713+
* ":echowindow expr1 ..." Print a message in the messages window
67126714
* ":echoerr expr1 ..." Print an error
67136715
* ":echoconsole expr1 ..." Print a message on stdout
67146716
* Each gets spaces around each argument and a newline at the end for
@@ -6726,6 +6728,9 @@ ex_execute(exarg_T *eap)
67266728
long start_lnum = SOURCING_LNUM;
67276729

67286730
ga_init2(&ga, 1, 80);
6731+
#ifdef HAS_MESSAGE_WINDOW
6732+
in_echowindow = (eap->cmdidx == CMD_echowindow);
6733+
#endif
67296734

67306735
if (eap->skip)
67316736
++emsg_skip;
@@ -6780,15 +6785,17 @@ ex_execute(exarg_T *eap)
67806785
// use the first line of continuation lines for messages
67816786
SOURCING_LNUM = start_lnum;
67826787

6783-
if (eap->cmdidx == CMD_echomsg || eap->cmdidx == CMD_echoerr)
6788+
if (eap->cmdidx == CMD_echomsg
6789+
|| eap->cmdidx == CMD_echowindow
6790+
|| eap->cmdidx == CMD_echoerr)
67846791
{
67856792
// Mark the already saved text as finishing the line, so that what
67866793
// follows is displayed on a new line when scrolling back at the
67876794
// more prompt.
67886795
msg_sb_eol();
67896796
}
67906797

6791-
if (eap->cmdidx == CMD_echomsg)
6798+
if (eap->cmdidx == CMD_echomsg || eap->cmdidx == CMD_echowindow)
67926799
{
67936800
msg_attr(ga.ga_data, echo_attr);
67946801
out_flush();
@@ -6835,6 +6842,7 @@ ex_execute(exarg_T *eap)
68356842
if (msg_col == 0)
68366843
msg_col = 1;
68376844
}
6845+
in_echowindow = FALSE;
68386846
#endif
68396847
set_nextcmd(eap, arg);
68406848
}

src/ex_cmdidxs.h

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -10,27 +10,27 @@ static const unsigned short cmdidxs1[26] =
1010
/* c */ 45,
1111
/* d */ 112,
1212
/* e */ 137,
13-
/* f */ 165,
14-
/* g */ 182,
15-
/* h */ 188,
16-
/* i */ 197,
17-
/* j */ 217,
18-
/* k */ 219,
19-
/* l */ 224,
20-
/* m */ 287,
21-
/* n */ 307,
22-
/* o */ 327,
23-
/* p */ 339,
24-
/* q */ 378,
25-
/* r */ 381,
26-
/* s */ 401,
27-
/* t */ 471,
28-
/* u */ 517,
29-
/* v */ 528,
30-
/* w */ 549,
31-
/* x */ 563,
32-
/* y */ 573,
33-
/* z */ 574
13+
/* f */ 166,
14+
/* g */ 183,
15+
/* h */ 189,
16+
/* i */ 198,
17+
/* j */ 218,
18+
/* k */ 220,
19+
/* l */ 225,
20+
/* m */ 288,
21+
/* n */ 308,
22+
/* o */ 328,
23+
/* p */ 340,
24+
/* q */ 379,
25+
/* r */ 382,
26+
/* s */ 402,
27+
/* t */ 472,
28+
/* u */ 518,
29+
/* v */ 529,
30+
/* w */ 550,
31+
/* x */ 564,
32+
/* y */ 574,
33+
/* z */ 575
3434
};
3535

3636
/*
@@ -45,7 +45,7 @@ static const unsigned char cmdidxs2[26][26] =
4545
/* b */ { 2, 0, 0, 5, 6, 8, 0, 0, 0, 0, 0, 9, 10, 11, 12, 13, 0, 14, 0, 0, 0, 0, 23, 0, 0, 0 },
4646
/* c */ { 3, 12, 16, 18, 20, 22, 25, 0, 0, 0, 0, 33, 38, 41, 47, 57, 59, 60, 61, 0, 63, 0, 66, 0, 0, 0 },
4747
/* d */ { 0, 0, 0, 0, 0, 0, 0, 0, 8, 18, 0, 19, 0, 0, 20, 0, 0, 22, 23, 0, 0, 0, 0, 0, 0, 0 },
48-
/* e */ { 1, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 8, 10, 11, 0, 0, 0, 0, 0, 0, 0, 22, 0, 23, 0, 0 },
48+
/* e */ { 1, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 9, 11, 12, 0, 0, 0, 0, 0, 0, 0, 23, 0, 24, 0, 0 },
4949
/* f */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 0 },
5050
/* g */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 2, 0, 0, 4, 5, 0, 0, 0, 0 },
5151
/* h */ { 5, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
@@ -69,4 +69,4 @@ static const unsigned char cmdidxs2[26][26] =
6969
/* z */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }
7070
};
7171

72-
static const int command_count = 591;
72+
static const int command_count = 592;

src/ex_cmds.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1011,6 +1011,7 @@ do_bang(
10111011
if (addr_count == 0) // :!
10121012
{
10131013
// echo the command
1014+
dont_use_message_window();
10141015
msg_start();
10151016
msg_putchar(':');
10161017
msg_putchar('!');
@@ -1150,7 +1151,8 @@ do_filter(
11501151
#if defined(FEAT_EVAL)
11511152
if (!aborting())
11521153
#endif
1153-
(void)semsg(_(e_cant_create_file_str), itmp); // will call wait_return
1154+
// will call wait_return()
1155+
(void)semsg(_(e_cant_create_file_str), itmp);
11541156
goto filterend;
11551157
}
11561158
if (curbuf != old_curbuf)
@@ -4330,7 +4332,7 @@ ex_substitute(exarg_T *eap)
43304332
// needed
43314333
msg_no_more = TRUE;
43324334
// write message same highlighting as for
4333-
// wait_return
4335+
// wait_return()
43344336
smsg_attr(HL_ATTR(HLF_R),
43354337
_("replace with %s (y/n/a/q/l/^E/^Y)?"), sub);
43364338
msg_no_more = FALSE;

src/ex_cmds.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -548,6 +548,9 @@ EXCMD(CMD_echoconsole, "echoconsole", ex_execute,
548548
EXCMD(CMD_echon, "echon", ex_echo,
549549
EX_EXTRA|EX_NOTRLCOM|EX_EXPR_ARG|EX_SBOXOK|EX_CMDWIN|EX_LOCK_OK,
550550
ADDR_NONE),
551+
EXCMD(CMD_echowindow, "echowindow", ex_execute,
552+
EX_EXTRA|EX_NOTRLCOM|EX_EXPR_ARG|EX_SBOXOK|EX_CMDWIN|EX_LOCK_OK,
553+
ADDR_NONE),
551554
EXCMD(CMD_else, "else", ex_else,
552555
EX_TRLBAR|EX_SBOXOK|EX_CMDWIN|EX_LOCK_OK|EX_WHOLE,
553556
ADDR_NONE),

src/ex_cmds2.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,7 @@ check_changed_any(
421421
if (!(p_confirm || (cmdmod.cmod_flags & CMOD_CONFIRM)))
422422
#endif
423423
{
424-
// There must be a wait_return for this message, do_buffer()
424+
// There must be a wait_return() for this message, do_buffer()
425425
// may cause a redraw. But wait_return() is a no-op when vgetc()
426426
// is busy (Quit used from window menu), then make sure we don't
427427
// cause a scroll up.

src/ex_docmd.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -885,7 +885,7 @@ do_cmdline(
885885
, in_vim9script() ? GETLINE_CONCAT_CONTBAR
886886
: GETLINE_CONCAT_CONT)) == NULL)
887887
{
888-
// Don't call wait_return for aborted command line. The NULL
888+
// Don't call wait_return() for aborted command line. The NULL
889889
// returned for the end of a sourced file or executed function
890890
// doesn't do this.
891891
if (KeyTyped && !(flags & DOCMD_REPEAT))
@@ -1361,7 +1361,7 @@ do_cmdline(
13611361
else if (need_wait_return)
13621362
{
13631363
/*
1364-
* The msg_start() above clears msg_didout. The wait_return we do
1364+
* The msg_start() above clears msg_didout. The wait_return() we do
13651365
* here should not overwrite the command that may be shown before
13661366
* doing that.
13671367
*/

0 commit comments

Comments
 (0)