Skip to content

Commit 820f30d

Browse files
committed
Merge remote-tracking branch 'vim/master'
2 parents 214f089 + 5d09a40 commit 820f30d

44 files changed

Lines changed: 246 additions & 461 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/options.txt

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1788,18 +1788,11 @@ A jump table for the options with a short description can be found at |Q_op|.
17881788
*'cmdheight'* *'ch'*
17891789
'cmdheight' 'ch' number (default 1)
17901790
global or local to tab page
1791-
Number of screen lines to use for the command-line. Helps avoiding
1792-
|hit-enter| prompts.
1791+
Number of screen lines to use for the command-line. A larger value
1792+
helps avoiding |hit-enter| prompts.
17931793
The value of this option is stored with the tab page, so that each tab
17941794
page can have a different value.
17951795

1796-
When 'cmdheight' is zero, there is no command-line unless it is being
1797-
used. Informative messages will be displayed in a popup notification
1798-
window at the bottom if the window, using the MessageWindow highlight
1799-
group {only if compiled with the +popupwin and +timers features},
1800-
otherwise they will not be displayed. Other messages will cause the
1801-
|hit-enter| prompt. Expect some other unexpected behavior too.
1802-
18031796
*'cmdwinheight'* *'cwh'*
18041797
'cmdwinheight' 'cwh' number (default 7)
18051798
global
@@ -6606,11 +6599,9 @@ A jump table for the options with a short description can be found at |Q_op|.
66066599
45% relative position in the file
66076600
If 'rulerformat' is set, it will determine the contents of the ruler.
66086601
Each window has its own ruler. If a window has a status line, the
6609-
ruler is shown there. If a window doesn't have a status line and
6610-
'cmdheight' is zero, the ruler is not shown. Otherwise it is shown in
6611-
the last line of the screen. If the statusline is given by
6612-
'statusline' (i.e. not empty), this option takes precedence over
6613-
'ruler' and 'rulerformat'.
6602+
ruler is shown there. Otherwise it is shown in the last line of the
6603+
screen. If the statusline is given by 'statusline' (i.e. not empty),
6604+
this option takes precedence over 'ruler' and 'rulerformat'.
66146605
If the number of characters displayed is different from the number of
66156606
bytes in the text (e.g., for a TAB or a multibyte character), both
66166607
the text column (byte number) and the screen column are shown,
@@ -7260,7 +7251,6 @@ A jump table for the options with a short description can be found at |Q_op|.
72607251
|+cmdline_info| feature}
72617252
Show (partial) command in the last line of the screen. Set this
72627253
option off if your terminal is slow.
7263-
The option has no effect when 'cmdheight' is zero.
72647254
In Visual mode the size of the selected area is shown:
72657255
- When selecting characters within a line, the number of characters.
72667256
If the number of bytes is different it is also displayed: "2-6"
@@ -7310,7 +7300,6 @@ A jump table for the options with a short description can be found at |Q_op|.
73107300
If in Insert, Replace or Visual mode put a message on the last line.
73117301
Use the 'M' flag in 'highlight' to set the type of highlighting for
73127302
this message.
7313-
The option has no effect when 'cmdheight' is zero.
73147303
When |XIM| may be used the message will include "XIM". But this
73157304
doesn't mean XIM is really active, especially when 'imactivatekey' is
73167305
not set.

runtime/doc/windows.txt

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,9 +256,16 @@ and 'winminwidth' are relevant.
256256
*:vert* *:vertical*
257257
:vert[ical] {cmd}
258258
Execute {cmd}. If it contains a command that splits a window,
259-
it will be split vertically.
259+
it will be split vertically. For `vertical wincmd =` windows
260+
will be equialized only vertically.
260261
Doesn't work for |:execute| and |:normal|.
261262

263+
*:hor* *:horizontal*
264+
:hor[izontal] {cmd}
265+
Execute {cmd}. Currently only makes a difference for
266+
`horizontal wincmd =`, which will equal windows only
267+
horizontally.
268+
262269
:lefta[bove] {cmd} *:lefta* *:leftabove*
263270
:abo[veleft] {cmd} *:abo* *:aboveleft*
264271
Execute {cmd}. If it contains a command that splits a window,
@@ -553,6 +560,10 @@ CTRL-W = Make all windows (almost) equally high and wide, but use
553560
'winheight' and 'winwidth' for the current window.
554561
Windows with 'winfixheight' set keep their height and windows
555562
with 'winfixwidth' set keep their width.
563+
To equalize only vertically (make window equally high) use
564+
`vertical wincmd =`
565+
To equalize only horizontally (make window equally wide) use
566+
`horizontal wincmd =`
556567

557568
:res[ize] -N *:res* *:resize* *CTRL-W_-*
558569
CTRL-W - Decrease current window height by N (default 1).

src/drawscreen.c

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -654,8 +654,8 @@ win_redr_ruler(win_T *wp, int always, int ignore_pum)
654654
int off = 0;
655655
int width;
656656

657-
// If 'ruler' off or messages area disabled, don't do anything
658-
if (!p_ru || (wp->w_status_height == 0 && p_ch == 0))
657+
// If 'ruler' off don't do anything
658+
if (!p_ru)
659659
return;
660660

661661
/*
@@ -676,7 +676,7 @@ win_redr_ruler(win_T *wp, int always, int ignore_pum)
676676
return;
677677

678678
#ifdef FEAT_STL_OPT
679-
if (*p_ruf && p_ch > 0)
679+
if (*p_ruf)
680680
{
681681
int called_emsg_before = called_emsg;
682682

@@ -1814,13 +1814,9 @@ win_update(win_T *wp)
18141814

18151815
// Move the entries that were scrolled, disable
18161816
// the entries for the lines to be redrawn.
1817-
// Avoid using a wrong index when 'cmdheight' is
1818-
// zero and wp->w_height == Rows.
18191817
if ((wp->w_lines_valid += j) > wp->w_height)
18201818
wp->w_lines_valid = wp->w_height;
1821-
for (idx = wp->w_lines_valid >= wp->w_height
1822-
? wp->w_height - 1 : wp->w_lines_valid;
1823-
idx - j >= 0; idx--)
1819+
for (idx = wp->w_lines_valid; idx - j >= 0; idx--)
18241820
wp->w_lines[idx] = wp->w_lines[idx - j];
18251821
while (idx >= 0)
18261822
wp->w_lines[idx--].wl_valid = FALSE;
@@ -2420,8 +2416,7 @@ win_update(win_T *wp)
24202416
if (wp->w_lines_valid > wp->w_height)
24212417
wp->w_lines_valid = wp->w_height;
24222418
for (i = wp->w_lines_valid; i - j >= idx; --i)
2423-
if (i < Rows)
2424-
wp->w_lines[i] = wp->w_lines[i - j];
2419+
wp->w_lines[i] = wp->w_lines[i - j];
24252420

24262421
// The w_lines[] entries for inserted lines are
24272422
// now invalid, but wl_size may be used above.
@@ -2502,8 +2497,7 @@ win_update(win_T *wp)
25022497
// Past end of the window or end of the screen. Note that after
25032498
// resizing wp->w_height may be end up too big. That's a problem
25042499
// elsewhere, but prevent a crash here.
2505-
if (row > wp->w_height
2506-
|| row + wp->w_winrow >= (p_ch > 0 ? Rows : Rows + 1))
2500+
if (row > wp->w_height || row + wp->w_winrow >= Rows)
25072501
{
25082502
// we may need the size of that too long line later on
25092503
if (dollar_vcol == -1)
@@ -2557,7 +2551,7 @@ win_update(win_T *wp)
25572551

25582552
// Safety check: if any of the wl_size values is wrong we might go over
25592553
// the end of w_lines[].
2560-
if (idx >= (p_ch > 0 ? Rows : Rows + 1))
2554+
if (idx >= Rows)
25612555
break;
25622556
}
25632557

@@ -2945,8 +2939,7 @@ redraw_asap(int type)
29452939
redraw_later(type);
29462940
if (msg_scrolled
29472941
|| (State != MODE_NORMAL && State != MODE_NORMAL_BUSY)
2948-
|| exiting
2949-
|| p_ch == 0)
2942+
|| exiting)
29502943
return ret;
29512944

29522945
// Allocate space to save the text displayed in the command line area.

src/eval.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6832,17 +6832,18 @@ ex_execute(exarg_T *eap)
68326832
if (eap->skip)
68336833
--emsg_skip;
68346834
#ifdef HAS_MESSAGE_WINDOW
6835-
if (use_message_window() && eap->cmdidx != CMD_execute)
6835+
if (eap->cmdidx == CMD_echowindow)
68366836
{
68376837
// show the message window now
68386838
ex_redraw(eap);
68396839

68406840
// do not overwrite messages
6841+
// TODO: only for message window
68416842
msg_didout = TRUE;
68426843
if (msg_col == 0)
68436844
msg_col = 1;
6845+
in_echowindow = FALSE;
68446846
}
6845-
in_echowindow = FALSE;
68466847
#endif
68476848
set_nextcmd(eap, arg);
68486849
}

src/evalfunc.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4811,9 +4811,12 @@ f_getchangelist(typval_T *argvars, typval_T *rettv)
48114811
l = list_alloc();
48124812
if (l == NULL)
48134813
return;
4814-
48154814
if (list_append_list(rettv->vval.v_list, l) == FAIL)
4815+
{
4816+
vim_free(l);
48164817
return;
4818+
}
4819+
48174820
/*
48184821
* The current window change list index tracks only the position for the
48194822
* current buffer. For other buffers use the stored index for the current
@@ -5045,9 +5048,12 @@ f_getjumplist(typval_T *argvars, typval_T *rettv)
50455048
l = list_alloc();
50465049
if (l == NULL)
50475050
return;
5048-
50495051
if (list_append_list(rettv->vval.v_list, l) == FAIL)
5052+
{
5053+
vim_free(l);
50505054
return;
5055+
}
5056+
50515057
list_append_number(rettv->vval.v_list, (varnumber_T)wp->w_jumplistidx);
50525058

50535059
for (i = 0; i < wp->w_jumplistlen; ++i)

src/evalwindow.c

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ find_tabwin(
261261
}
262262

263263
/*
264-
* Get the layout of the given tab page for winlayout().
264+
* Get the layout of the given tab page for winlayout() and add it to "l".
265265
*/
266266
static void
267267
get_framelayout(frame_T *fr, list_T *l, int outer)
@@ -281,7 +281,11 @@ get_framelayout(frame_T *fr, list_T *l, int outer)
281281
fr_list = list_alloc();
282282
if (fr_list == NULL)
283283
return;
284-
list_append_list(l, fr_list);
284+
if (list_append_list(l, fr_list) == FAIL)
285+
{
286+
vim_free(fr_list);
287+
return;
288+
}
285289
}
286290

287291
if (fr->fr_layout == FR_LEAF)
@@ -300,7 +304,12 @@ get_framelayout(frame_T *fr, list_T *l, int outer)
300304
win_list = list_alloc();
301305
if (win_list == NULL)
302306
return;
303-
list_append_list(fr_list, win_list);
307+
if (list_append_list(fr_list, win_list) == FAIL)
308+
{
309+
vim_free(win_list);
310+
return;
311+
}
312+
304313
child = fr->fr_child;
305314
while (child != NULL)
306315
{

src/ex_cmdidxs.h

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -13,24 +13,24 @@ static const unsigned short cmdidxs1[26] =
1313
/* f */ 166,
1414
/* g */ 183,
1515
/* 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
16+
/* i */ 199,
17+
/* j */ 219,
18+
/* k */ 221,
19+
/* l */ 226,
20+
/* m */ 289,
21+
/* n */ 309,
22+
/* o */ 329,
23+
/* p */ 341,
24+
/* q */ 380,
25+
/* r */ 383,
26+
/* s */ 403,
27+
/* t */ 473,
28+
/* u */ 519,
29+
/* v */ 530,
30+
/* w */ 551,
31+
/* x */ 565,
32+
/* y */ 575,
33+
/* z */ 576
3434
};
3535

3636
/*
@@ -48,7 +48,7 @@ static const unsigned char cmdidxs2[26][26] =
4848
/* 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 },
51-
/* 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 },
51+
/* h */ { 5, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
5252
/* i */ { 1, 0, 0, 0, 0, 3, 0, 0, 0, 4, 0, 5, 6, 0, 0, 0, 0, 0, 15, 0, 17, 0, 0, 0, 0, 0 },
5353
/* j */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 },
5454
/* k */ { 0, 0, 0, 0, 1, 0, 0, 0, 0, 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 = 592;
72+
static const int command_count = 593;

src/ex_cmds.c

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1011,7 +1011,6 @@ do_bang(
10111011
if (addr_count == 0) // :!
10121012
{
10131013
// echo the command
1014-
dont_use_message_window();
10151014
msg_start();
10161015
msg_putchar(':');
10171016
msg_putchar('!');
@@ -3702,7 +3701,6 @@ ex_substitute(exarg_T *eap)
37023701
int endcolumn = FALSE; // cursor in last column when done
37033702
pos_T old_cursor = curwin->w_cursor;
37043703
int start_nsubs;
3705-
int cmdheight0 = p_ch == 0;
37063704
#ifdef FEAT_EVAL
37073705
int save_ma = 0;
37083706
int save_sandbox = 0;
@@ -4012,14 +4010,6 @@ ex_substitute(exarg_T *eap)
40124010
}
40134011
}
40144012

4015-
if (cmdheight0)
4016-
{
4017-
// If cmdheight is 0, cmdheight must be set to 1 when we enter command
4018-
// line.
4019-
set_option_value((char_u *)"ch", 1L, NULL, 0);
4020-
redraw_statuslines();
4021-
}
4022-
40234013
/*
40244014
* Check for a match on each line.
40254015
*/
@@ -4902,10 +4892,6 @@ ex_substitute(exarg_T *eap)
49024892
changed_window_setting();
49034893
#endif
49044894

4905-
// Restore cmdheight
4906-
if (cmdheight0)
4907-
set_option_value((char_u *)"ch", 0L, NULL, 0);
4908-
49094895
vim_regfree(regmatch.regprog);
49104896
vim_free(sub_copy);
49114897

src/ex_cmds.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -707,6 +707,9 @@ EXCMD(CMD_hide, "hide", ex_hide,
707707
EXCMD(CMD_history, "history", ex_history,
708708
EX_EXTRA|EX_TRLBAR|EX_CMDWIN|EX_LOCK_OK,
709709
ADDR_NONE),
710+
EXCMD(CMD_horizontal, "horizontal", ex_wrongmodifier,
711+
EX_NEEDARG|EX_EXTRA|EX_NOTRLCOM,
712+
ADDR_NONE),
710713
EXCMD(CMD_insert, "insert", ex_append,
711714
EX_BANG|EX_RANGE|EX_TRLBAR|EX_CMDWIN|EX_LOCK_OK|EX_MODIFY,
712715
ADDR_LINES),

src/ex_docmd.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2993,8 +2993,13 @@ parse_command_modifiers(
29932993
continue;
29942994
}
29952995

2996+
case 'h': if (checkforcmd_noparen(&eap->cmd, "horizontal", 3))
2997+
{
2998+
cmod->cmod_split |= WSP_HOR;
2999+
continue;
3000+
}
29963001
// ":hide" and ":hide | cmd" are not modifiers
2997-
case 'h': if (p != eap->cmd || !checkforcmd_noparen(&p, "hide", 3)
3002+
if (p != eap->cmd || !checkforcmd_noparen(&p, "hide", 3)
29983003
|| *p == NUL || ends_excmd(*p))
29993004
break;
30003005
eap->cmd = p;
@@ -8378,14 +8383,9 @@ ex_redraw(exarg_T *eap)
83788383
// After drawing the statusline screen_attr may still be set.
83798384
screen_stop_highlight();
83808385

8381-
#ifdef HAS_MESSAGE_WINDOW
8382-
if (!use_message_window()) // append messages in the message window
8383-
#endif
8384-
{
8385-
// Reset msg_didout, so that a message that's there is overwritten.
8386-
msg_didout = FALSE;
8387-
msg_col = 0;
8388-
}
8386+
// Reset msg_didout, so that a message that's there is overwritten.
8387+
msg_didout = FALSE;
8388+
msg_col = 0;
83898389

83908390
// No need to wait after an intentional redraw.
83918391
need_wait_return = FALSE;

0 commit comments

Comments
 (0)