Skip to content

Commit 44a2f92

Browse files
committed
patch 7.4.1611
Problem: The versplit feature makes the code uneccessary complicated. Solution: Remove FEAT_VERTSPLIT, always support vertical splits when FEAT_WINDOWS is defined.
1 parent cc6cf9b commit 44a2f92

31 files changed

Lines changed: 141 additions & 397 deletions

src/buffer.c

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4607,9 +4607,9 @@ do_arg_all(
46074607
old_curwin = curwin;
46084608
old_curtab = curtab;
46094609

4610-
#ifdef FEAT_GUI
4610+
# ifdef FEAT_GUI
46114611
need_mouse_correct = TRUE;
4612-
#endif
4612+
# endif
46134613

46144614
/*
46154615
* Try closing all windows that are not in the argument list.
@@ -4629,10 +4629,7 @@ do_arg_all(
46294629
buf = wp->w_buffer;
46304630
if (buf->b_ffname == NULL
46314631
|| (!keep_tabs && buf->b_nwindows > 1)
4632-
#ifdef FEAT_VERTSPLIT
4633-
|| wp->w_width != Columns
4634-
#endif
4635-
)
4632+
|| wp->w_width != Columns)
46364633
i = opened_len;
46374634
else
46384635
{
@@ -4901,13 +4898,11 @@ ex_buffer_all(exarg_T *eap)
49014898
{
49024899
wpnext = wp->w_next;
49034900
if ((wp->w_buffer->b_nwindows > 1
4904-
#ifdef FEAT_VERTSPLIT
4901+
#ifdef FEAT_WINDOWS
49054902
|| ((cmdmod.split & WSP_VERT)
49064903
? wp->w_height + wp->w_status_height < Rows - p_ch
49074904
- tabline_height()
49084905
: wp->w_width != Columns)
4909-
#endif
4910-
#ifdef FEAT_WINDOWS
49114906
|| (had_tab > 0 && wp != firstwin)
49124907
#endif
49134908
) && firstwin != lastwin

src/charset.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1093,7 +1093,7 @@ win_lbr_chartabsize(
10931093
&& vim_isbreak(c)
10941094
&& !vim_isbreak(s[1])
10951095
&& wp->w_p_wrap
1096-
# ifdef FEAT_VERTSPLIT
1096+
# ifdef FEAT_WINDOWS
10971097
&& wp->w_width != 0
10981098
# endif
10991099
)
@@ -1250,10 +1250,10 @@ in_win_border(win_T *wp, colnr_T vcol)
12501250
int width1; /* width of first line (after line number) */
12511251
int width2; /* width of further lines */
12521252

1253-
#ifdef FEAT_VERTSPLIT
1253+
# ifdef FEAT_WINDOWS
12541254
if (wp->w_width == 0) /* there is no border */
12551255
return FALSE;
1256-
#endif
1256+
# endif
12571257
width1 = W_WIDTH(wp) - win_col_off(wp);
12581258
if ((int)vcol < width1 - 1)
12591259
return FALSE;

src/eval.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13734,7 +13734,7 @@ f_has(typval_T *argvars, typval_T *rettv)
1373413734
#ifdef FEAT_VIMINFO
1373513735
"viminfo",
1373613736
#endif
13737-
#ifdef FEAT_VERTSPLIT
13737+
#ifdef FEAT_WINDOWS
1373813738
"vertsplit",
1373913739
#endif
1374013740
#ifdef FEAT_VIRTUALEDIT
@@ -20646,10 +20646,8 @@ f_winrestcmd(typval_T *argvars UNUSED, typval_T *rettv)
2064620646
{
2064720647
sprintf((char *)buf, "%dresize %d|", winnr, wp->w_height);
2064820648
ga_concat(&ga, buf);
20649-
# ifdef FEAT_VERTSPLIT
2065020649
sprintf((char *)buf, "vert %dresize %d|", winnr, wp->w_width);
2065120650
ga_concat(&ga, buf);
20652-
# endif
2065320651
++winnr;
2065420652
}
2065520653
ga_append(&ga, NUL);
@@ -20701,7 +20699,7 @@ f_winrestview(typval_T *argvars, typval_T *rettv UNUSED)
2070120699

2070220700
check_cursor();
2070320701
win_new_height(curwin, curwin->w_height);
20704-
# ifdef FEAT_VERTSPLIT
20702+
# ifdef FEAT_WINDOWS
2070520703
win_new_width(curwin, W_WIDTH(curwin));
2070620704
# endif
2070720705
changed_window_setting();
@@ -20756,7 +20754,7 @@ f_winwidth(typval_T *argvars, typval_T *rettv)
2075620754
if (wp == NULL)
2075720755
rettv->vval.v_number = -1;
2075820756
else
20759-
#ifdef FEAT_VERTSPLIT
20757+
#ifdef FEAT_WINDOWS
2076020758
rettv->vval.v_number = wp->w_width;
2076120759
#else
2076220760
rettv->vval.v_number = Columns;

src/ex_cmds.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5867,11 +5867,9 @@ ex_help(exarg_T *eap)
58675867
* specified, the current window is vertically split and
58685868
* narrow. */
58695869
n = WSP_HELP;
5870-
# ifdef FEAT_VERTSPLIT
58715870
if (cmdmod.split == 0 && curwin->w_width != Columns
58725871
&& curwin->w_width < 80)
58735872
n |= WSP_TOP;
5874-
# endif
58755873
if (win_split(0, n) == FAIL)
58765874
goto erret;
58775875
#else

src/ex_docmd.c

Lines changed: 5 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2013,7 +2013,7 @@ do_one_cmd(
20132013

20142014
case 'v': if (checkforcmd(&ea.cmd, "vertical", 4))
20152015
{
2016-
#ifdef FEAT_VERTSPLIT
2016+
#ifdef FEAT_WINDOWS
20172017
cmdmod.split |= WSP_VERT;
20182018
#endif
20192019
continue;
@@ -7923,14 +7923,6 @@ ex_splitview(exarg_T *eap)
79237923
int browse_flag = cmdmod.browse;
79247924
# endif
79257925

7926-
# ifndef FEAT_VERTSPLIT
7927-
if (eap->cmdidx == CMD_vsplit || eap->cmdidx == CMD_vnew)
7928-
{
7929-
ex_ni(eap);
7930-
return;
7931-
}
7932-
# endif
7933-
79347926
# ifdef FEAT_GUI
79357927
need_mouse_correct = TRUE;
79367928
# endif
@@ -7942,10 +7934,8 @@ ex_splitview(exarg_T *eap)
79427934
{
79437935
if (eap->cmdidx == CMD_split)
79447936
eap->cmdidx = CMD_new;
7945-
# ifdef FEAT_VERTSPLIT
79467937
if (eap->cmdidx == CMD_vsplit)
79477938
eap->cmdidx = CMD_vnew;
7948-
# endif
79497939
}
79507940
# endif
79517941

@@ -7964,9 +7954,7 @@ ex_splitview(exarg_T *eap)
79647954
# endif
79657955
# ifdef FEAT_BROWSE
79667956
if (cmdmod.browse
7967-
# ifdef FEAT_VERTSPLIT
79687957
&& eap->cmdidx != CMD_vnew
7969-
# endif
79707958
&& eap->cmdidx != CMD_new)
79717959
{
79727960
# ifdef FEAT_AUTOCMD
@@ -8224,11 +8212,10 @@ ex_resize(exarg_T *eap)
82248212
;
82258213
}
82268214

8227-
#ifdef FEAT_GUI
8215+
# ifdef FEAT_GUI
82288216
need_mouse_correct = TRUE;
8229-
#endif
8217+
# endif
82308218
n = atol((char *)eap->arg);
8231-
#ifdef FEAT_VERTSPLIT
82328219
if (cmdmod.split & WSP_VERT)
82338220
{
82348221
if (*eap->arg == '-' || *eap->arg == '+')
@@ -8238,7 +8225,6 @@ ex_resize(exarg_T *eap)
82388225
win_setwidth_win((int)n, wp);
82398226
}
82408227
else
8241-
#endif
82428228
{
82438229
if (*eap->arg == '-' || *eap->arg == '+')
82448230
n += curwin->w_height;
@@ -8397,7 +8383,7 @@ do_exedit(
83978383
if ((eap->cmdidx == CMD_new
83988384
|| eap->cmdidx == CMD_tabnew
83998385
|| eap->cmdidx == CMD_tabedit
8400-
#ifdef FEAT_VERTSPLIT
8386+
#ifdef FEAT_WINDOWS
84018387
|| eap->cmdidx == CMD_vnew
84028388
#endif
84038389
) && *eap->arg == NUL)
@@ -8409,7 +8395,7 @@ do_exedit(
84098395
old_curwin == NULL ? curwin : NULL);
84108396
}
84118397
else if ((eap->cmdidx != CMD_split
8412-
#ifdef FEAT_VERTSPLIT
8398+
#ifdef FEAT_WINDOWS
84138399
&& eap->cmdidx != CMD_vsplit
84148400
#endif
84158401
)

src/ex_getln.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -500,11 +500,7 @@ getcmdline(
500500
}
501501
else
502502
{
503-
# ifdef FEAT_VERTSPLIT
504503
win_redraw_last_status(topframe);
505-
# else
506-
lastwin->w_redr_status = TRUE;
507-
# endif
508504
redraw_statuslines();
509505
}
510506
KeyTyped = skt;

src/feature.h

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@
9797
/*
9898
* +windows Multiple windows. Without this there is no help
9999
* window and no status lines.
100+
* +vertsplit Vertically split windows.
100101
*/
101102
#ifdef FEAT_SMALL
102103
# define FEAT_WINDOWS
@@ -111,16 +112,6 @@
111112
# define FEAT_LISTCMDS
112113
#endif
113114

114-
/*
115-
* +vertsplit Vertically split windows.
116-
*/
117-
#ifdef FEAT_NORMAL
118-
# define FEAT_VERTSPLIT
119-
#endif
120-
#if defined(FEAT_VERTSPLIT) && !defined(FEAT_WINDOWS)
121-
# define FEAT_WINDOWS
122-
#endif
123-
124115
/*
125116
* +cmdhist Command line history.
126117
*/
@@ -144,8 +135,8 @@
144135
# define FEAT_JUMPLIST
145136
#endif
146137

147-
/* the cmdline-window requires FEAT_VERTSPLIT and FEAT_CMDHIST */
148-
#if defined(FEAT_VERTSPLIT) && defined(FEAT_CMDHIST)
138+
/* the cmdline-window requires FEAT_WINDOWS and FEAT_CMDHIST */
139+
#if defined(FEAT_WINDOWS) && defined(FEAT_CMDHIST)
149140
# define FEAT_CMDWIN
150141
#endif
151142

@@ -601,7 +592,7 @@
601592
* +mksession ":mksession" command.
602593
* Requires +windows and +vertsplit.
603594
*/
604-
#if defined(FEAT_NORMAL) && defined(FEAT_WINDOWS) && defined(FEAT_VERTSPLIT)
595+
#if defined(FEAT_NORMAL) && defined(FEAT_WINDOWS)
605596
# define FEAT_SESSION
606597
#endif
607598

src/globals.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,7 @@ EXTERN int gui_prev_topfill INIT(= 0);
427427
EXTERN int drag_status_line INIT(= FALSE); /* dragging the status line */
428428
EXTERN int postponed_mouseshape INIT(= FALSE); /* postponed updating the
429429
mouse pointer shape */
430-
# ifdef FEAT_VERTSPLIT
430+
# ifdef FEAT_WINDOWS
431431
EXTERN int drag_sep_line INIT(= FALSE); /* dragging vert separator */
432432
# endif
433433
# endif
@@ -1547,9 +1547,7 @@ EXTERN char_u e_umark[] INIT(= N_("E78: Unknown mark"));
15471547
EXTERN char_u e_wildexpand[] INIT(= N_("E79: Cannot expand wildcards"));
15481548
#ifdef FEAT_WINDOWS
15491549
EXTERN char_u e_winheight[] INIT(= N_("E591: 'winheight' cannot be smaller than 'winminheight'"));
1550-
# ifdef FEAT_VERTSPLIT
15511550
EXTERN char_u e_winwidth[] INIT(= N_("E592: 'winwidth' cannot be smaller than 'winminwidth'"));
1552-
# endif
15531551
#endif
15541552
EXTERN char_u e_write[] INIT(= N_("E80: Error while writing"));
15551553
EXTERN char_u e_zerocount[] INIT(= N_("Zero count"));

src/gui.c

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1812,7 +1812,7 @@ gui_write(
18121812
gui.scroll_region_bot = arg1;
18131813
}
18141814
break;
1815-
#ifdef FEAT_VERTSPLIT
1815+
#ifdef FEAT_WINDOWS
18161816
case 'V': /* Set vertical scroll region */
18171817
if (arg1 < arg2)
18181818
{
@@ -3128,7 +3128,7 @@ gui_send_mouse_event(
31283128
&& button != MOUSE_DRAG
31293129
# ifdef FEAT_MOUSESHAPE
31303130
&& !drag_status_line
3131-
# ifdef FEAT_VERTSPLIT
3131+
# ifdef FEAT_WINDOWS
31323132
&& !drag_sep_line
31333133
# endif
31343134
# endif
@@ -3406,7 +3406,7 @@ gui_init_which_components(char_u *oldval UNUSED)
34063406
case GO_RIGHT:
34073407
gui.which_scrollbars[SBAR_RIGHT] = TRUE;
34083408
break;
3409-
#ifdef FEAT_VERTSPLIT
3409+
#ifdef FEAT_WINDOWS
34103410
case GO_VLEFT:
34113411
if (win_hasvertsplit())
34123412
gui.which_scrollbars[SBAR_LEFT] = TRUE;
@@ -3839,7 +3839,7 @@ gui_create_scrollbar(scrollbar_T *sb, int type, win_T *wp)
38393839
sb->max = 1;
38403840
sb->top = 0;
38413841
sb->height = 0;
3842-
#ifdef FEAT_VERTSPLIT
3842+
#ifdef FEAT_WINDOWS
38433843
sb->width = 0;
38443844
#endif
38453845
sb->status_height = 0;
@@ -4121,7 +4121,7 @@ gui_update_scrollbars(
41214121
long val, size, max; /* need 32 bits here */
41224122
int which_sb;
41234123
int h, y;
4124-
#ifdef FEAT_VERTSPLIT
4124+
#ifdef FEAT_WINDOWS
41254125
static win_T *prev_curwin = NULL;
41264126
#endif
41274127

@@ -4219,10 +4219,8 @@ gui_update_scrollbars(
42194219
#ifdef FEAT_WINDOWS
42204220
|| sb->top != wp->w_winrow
42214221
|| sb->status_height != wp->w_status_height
4222-
# ifdef FEAT_VERTSPLIT
42234222
|| sb->width != wp->w_width
42244223
|| prev_curwin != curwin
4225-
# endif
42264224
#endif
42274225
)
42284226
{
@@ -4232,9 +4230,7 @@ gui_update_scrollbars(
42324230
#ifdef FEAT_WINDOWS
42334231
sb->top = wp->w_winrow;
42344232
sb->status_height = wp->w_status_height;
4235-
# ifdef FEAT_VERTSPLIT
42364233
sb->width = wp->w_width;
4237-
# endif
42384234
#endif
42394235

42404236
/* Calculate height and position in pixels */
@@ -4316,7 +4312,7 @@ gui_update_scrollbars(
43164312
val, size, max);
43174313
}
43184314
}
4319-
#ifdef FEAT_VERTSPLIT
4315+
#ifdef FEAT_WINDOWS
43204316
prev_curwin = curwin;
43214317
#endif
43224318
--hold_gui_events;
@@ -4333,7 +4329,7 @@ gui_do_scrollbar(
43334329
int which, /* SBAR_LEFT or SBAR_RIGHT */
43344330
int enable) /* TRUE to enable scrollbar */
43354331
{
4336-
#ifdef FEAT_VERTSPLIT
4332+
#ifdef FEAT_WINDOWS
43374333
int midcol = curwin->w_wincol + curwin->w_width / 2;
43384334
int has_midcol = (wp->w_wincol <= midcol
43394335
&& wp->w_wincol + wp->w_width >= midcol);
@@ -4857,7 +4853,7 @@ gui_mouse_moved(int x, int y)
48574853
st[2] = KE_FILLER;
48584854
st[3] = (char_u)MOUSE_LEFT;
48594855
fill_mouse_coord(st + 4,
4860-
#ifdef FEAT_VERTSPLIT
4856+
#ifdef FEAT_WINDOWS
48614857
wp->w_wincol == 0 ? -1 : wp->w_wincol + MOUSE_COLOFF,
48624858
#else
48634859
-1,
@@ -4934,11 +4930,9 @@ xy2win(int x UNUSED, int y UNUSED)
49344930
}
49354931
else if (row > wp->w_height) /* below status line */
49364932
update_mouseshape(SHAPE_IDX_CLINE);
4937-
# ifdef FEAT_VERTSPLIT
49384933
else if (!(State & CMDLINE) && W_VSEP_WIDTH(wp) > 0 && col == wp->w_width
49394934
&& (row != wp->w_height || !stl_connected(wp)) && msg_scrolled == 0)
49404935
update_mouseshape(SHAPE_IDX_VSEP);
4941-
# endif
49424936
else if (!(State & CMDLINE) && W_STATUS_HEIGHT(wp) > 0
49434937
&& row == wp->w_height && msg_scrolled == 0)
49444938
update_mouseshape(SHAPE_IDX_STATUS);

src/gui.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ typedef struct GuiScrollbar
179179
/* Values measured in characters: */
180180
int top; /* Top of scroll bar (chars from row 0) */
181181
int height; /* Current height of scroll bar in rows */
182-
#ifdef FEAT_VERTSPLIT
182+
#ifdef FEAT_WINDOWS
183183
int width; /* Current width of scroll bar in cols */
184184
#endif
185185
int status_height; /* Height of status line */

0 commit comments

Comments
 (0)