vim-patch:8.0.1118: FEAT_WINDOWS adds a lot of #ifdefs

Problem:    FEAT_WINDOWS adds a lot of #ifdefs while it is nearly always
            enabled and only adds 7% to the binary size of the tiny build.
Solution:   Graduate FEAT_WINDOWS.
4033c55eca
This commit is contained in:
zeertzjq 2022-07-15 14:50:10 +08:00
parent 9777907467
commit 7b5b7b3cc6
7 changed files with 10 additions and 14 deletions

View File

@ -443,6 +443,7 @@ bool close_buffer(win_T *win, buf_T *buf, int action, bool abort_if_last, bool i
return false;
}
// check no autocommands closed the window
if (win != NULL // Avoid bogus clang warning.
&& win_valid_any_tab(win)) {
// Set b_last_cursor when closing the last window for the buffer.

View File

@ -4862,8 +4862,7 @@ void ex_help(exarg_T *eap)
* Re-use an existing help window or open a new one.
* Always open a new one for ":tab help".
*/
if (!bt_help(curwin->w_buffer)
|| cmdmod.cmod_tab != 0) {
if (!bt_help(curwin->w_buffer) || cmdmod.cmod_tab != 0) {
if (cmdmod.cmod_tab != 0) {
wp = NULL;
} else {

View File

@ -1018,8 +1018,7 @@ void check_arg_idx(win_T *win)
// We are editing the current entry in the argument list.
// Set "arg_had_last" if it's also the last one
win->w_arg_idx_invalid = false;
if (win->w_arg_idx == WARGCOUNT(win) - 1
&& win->w_alist == &global_alist) {
if (win->w_arg_idx == WARGCOUNT(win) - 1 && win->w_alist == &global_alist) {
arg_had_last = true;
}
}
@ -1150,8 +1149,7 @@ void do_argfile(exarg_T *eap, int argn)
}
curwin->w_arg_idx = argn;
if (argn == ARGCOUNT - 1
&& curwin->w_alist == &global_alist) {
if (argn == ARGCOUNT - 1 && curwin->w_alist == &global_alist) {
arg_had_last = true;
}

View File

@ -786,8 +786,7 @@ void curs_columns(win_T *wp, int may_scroll)
} else {
wp->w_wrow = wp->w_height_inner - 1 - wp->w_empty_rows;
}
} else if (wp->w_p_wrap
&& wp->w_width_inner != 0) {
} else if (wp->w_p_wrap && wp->w_width_inner != 0) {
width = textwidth + win_col_off2(wp);
// long line wrapping, adjust wp->w_wrow
@ -1083,8 +1082,7 @@ bool scrolldown(long line_count, int byfold)
* and move the cursor onto the displayed part of the window.
*/
int wrow = curwin->w_wrow;
if (curwin->w_p_wrap
&& curwin->w_width_inner != 0) {
if (curwin->w_p_wrap && curwin->w_width_inner != 0) {
validate_virtcol();
validate_cheight();
wrow += curwin->w_cline_height - 1 -

View File

@ -6012,8 +6012,7 @@ static void nv_g_home_m_cmd(cmdarg_T *cap)
cap->oap->motion_type = kMTCharWise;
cap->oap->inclusive = false;
if (curwin->w_p_wrap
&& curwin->w_width_inner != 0) {
if (curwin->w_p_wrap && curwin->w_width_inner != 0) {
int width1 = curwin->w_width_inner - curwin_col_off();
int width2 = width1 + curwin_col_off2();

View File

@ -1863,6 +1863,7 @@ parse_line:
// For "normal" tags: Do a quick check if the tag matches.
// This speeds up tag searching a lot!
if (orgpat.headlen) {
memset(&tagp, 0, sizeof(tagp));
tagp.tagname = lbuf;
tagp.tagname_end = (char_u *)vim_strchr((char *)lbuf, TAB);
if (tagp.tagname_end == NULL) {
@ -2784,7 +2785,7 @@ static int jumpto_tag(const char_u *lbuf_arg, int forceit, int keep_help)
// A :ta from a help file will keep the b_help flag set. For ":ptag"
// we need to use the flag from the window where we came from.
if (l_g_do_tagpreview != 0) {
keep_help_flag = curwin_save->w_buffer->b_help;
keep_help_flag = bt_help(curwin_save->w_buffer);
} else {
keep_help_flag = curbuf->b_help;
}

View File

@ -2656,7 +2656,7 @@ func Test_normal49_counts()
endfunc
func Test_normal50_commandline()
if !has("timers") || !has("cmdline_hist") || !has("vertsplit")
if !has("timers") || !has("cmdline_hist")
return
endif
func! DoTimerWork(id)