0
0
mirror of https://github.com/vim/vim.git synced 2025-09-23 03:43:49 -04:00

patch 8.0.1566: too many #ifdefs

Problem:    Too many #ifdefs.
Solution:   Graduate FEAT_SCROLLBIND and FEAT_CURSORBIND.
This commit is contained in:
Bram Moolenaar
2018-03-04 20:14:14 +01:00
parent 107279c17b
commit 8a3bb56230
19 changed files with 19 additions and 142 deletions

View File

@@ -1160,16 +1160,12 @@ diff_win_options(
# endif
/* Use 'scrollbind' and 'cursorbind' when available */
#ifdef FEAT_SCROLLBIND
if (!wp->w_p_diff)
wp->w_p_scb_save = wp->w_p_scb;
wp->w_p_scb = TRUE;
#endif
#ifdef FEAT_CURSORBIND
if (!wp->w_p_diff)
wp->w_p_crb_save = wp->w_p_crb;
wp->w_p_crb = TRUE;
#endif
if (!wp->w_p_diff)
wp->w_p_wrap_save = wp->w_p_wrap;
wp->w_p_wrap = FALSE;
@@ -1199,10 +1195,8 @@ diff_win_options(
/* make sure topline is not halfway a fold */
changed_window_setting_win(wp);
# endif
#ifdef FEAT_SCROLLBIND
if (vim_strchr(p_sbo, 'h') == NULL)
do_cmdline_cmd((char_u *)"set sbo+=hor");
#endif
/* Save the current values, to be restored in ex_diffoff(). */
wp->w_p_diff_saved = TRUE;
@@ -1221,9 +1215,7 @@ diff_win_options(
ex_diffoff(exarg_T *eap)
{
win_T *wp;
#ifdef FEAT_SCROLLBIND
int diffwin = FALSE;
#endif
FOR_ALL_WINDOWS(wp)
{
@@ -1237,14 +1229,10 @@ ex_diffoff(exarg_T *eap)
if (wp->w_p_diff_saved)
{
#ifdef FEAT_SCROLLBIND
if (wp->w_p_scb)
wp->w_p_scb = wp->w_p_scb_save;
#endif
#ifdef FEAT_CURSORBIND
if (wp->w_p_crb)
wp->w_p_crb = wp->w_p_crb_save;
#endif
if (!wp->w_p_wrap)
wp->w_p_wrap = wp->w_p_wrap_save;
#ifdef FEAT_FOLDING
@@ -1276,20 +1264,16 @@ ex_diffoff(exarg_T *eap)
/* Note: 'sbo' is not restored, it's a global option. */
diff_buf_adjust(wp);
}
#ifdef FEAT_SCROLLBIND
diffwin |= wp->w_p_diff;
#endif
}
/* Also remove hidden buffers from the list. */
if (eap->forceit)
diff_buf_clear();
#ifdef FEAT_SCROLLBIND
/* Remove "hor" from from 'scrollopt' if there are no diff windows left. */
if (!diffwin && vim_strchr(p_sbo, 'h') != NULL)
do_cmdline_cmd((char_u *)"set sbo-=hor");
#endif
}
/*