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

@@ -1583,8 +1583,7 @@ do_buffer(
/* Go to the other buffer. */ /* Go to the other buffer. */
set_curbuf(buf, action); set_curbuf(buf, action);
#if defined(FEAT_LISTCMDS) \ #if defined(FEAT_LISTCMDS)
&& (defined(FEAT_SCROLLBIND) || defined(FEAT_CURSORBIND))
if (action == DOBUF_SPLIT) if (action == DOBUF_SPLIT)
{ {
RESET_BINDING(curwin); /* reset 'scrollbind' and 'cursorbind' */ RESET_BINDING(curwin); /* reset 'scrollbind' and 'cursorbind' */

View File

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

View File

@@ -764,15 +764,11 @@ edit(
*/ */
ins_redraw(TRUE); ins_redraw(TRUE);
#ifdef FEAT_SCROLLBIND
if (curwin->w_p_scb) if (curwin->w_p_scb)
do_check_scrollbind(TRUE); do_check_scrollbind(TRUE);
#endif
#ifdef FEAT_CURSORBIND
if (curwin->w_p_crb) if (curwin->w_p_crb)
do_check_cursorbind(); do_check_cursorbind();
#endif
update_curswant(); update_curswant();
old_topline = curwin->w_topline; old_topline = curwin->w_topline;
#ifdef FEAT_DIFF #ifdef FEAT_DIFF

View File

@@ -5852,9 +5852,7 @@ f_has(typval_T *argvars, typval_T *rettv)
#ifdef FEAT_CSCOPE #ifdef FEAT_CSCOPE
"cscope", "cscope",
#endif #endif
#ifdef FEAT_CURSORBIND
"cursorbind", "cursorbind",
#endif
#ifdef CURSOR_SHAPE #ifdef CURSOR_SHAPE
"cursorshape", "cursorshape",
#endif #endif
@@ -6104,9 +6102,7 @@ f_has(typval_T *argvars, typval_T *rettv)
#if defined(FEAT_RUBY) && !defined(DYNAMIC_RUBY) #if defined(FEAT_RUBY) && !defined(DYNAMIC_RUBY)
"ruby", "ruby",
#endif #endif
#ifdef FEAT_SCROLLBIND
"scrollbind", "scrollbind",
#endif
#ifdef FEAT_CMDL_INFO #ifdef FEAT_CMDL_INFO
"showcmd", "showcmd",
"cmdline_info", "cmdline_info",

View File

@@ -4318,9 +4318,7 @@ do_ecmd(
if (topline == 0 && command == NULL) if (topline == 0 && command == NULL)
p_so = 999; /* force cursor halfway the window */ p_so = 999; /* force cursor halfway the window */
update_topline(); update_topline();
#ifdef FEAT_SCROLLBIND
curwin->w_scbind_pos = curwin->w_topline; curwin->w_scbind_pos = curwin->w_topline;
#endif
p_so = n; p_so = n;
redraw_curbuf_later(NOT_VALID); /* redraw this buffer later */ redraw_curbuf_later(NOT_VALID); /* redraw this buffer later */
} }
@@ -5270,10 +5268,8 @@ do_sub(exarg_T *eap)
setmouse(); /* disable mouse in xterm */ setmouse(); /* disable mouse in xterm */
#endif #endif
curwin->w_cursor.col = regmatch.startpos[0].col; curwin->w_cursor.col = regmatch.startpos[0].col;
#ifdef FEAT_CURSORBIND
if (curwin->w_p_crb) if (curwin->w_p_crb)
do_check_cursorbind(); do_check_cursorbind();
#endif
/* When 'cpoptions' contains "u" don't sync undo when /* When 'cpoptions' contains "u" don't sync undo when
* asking for confirmation. */ * asking for confirmation. */

View File

@@ -3232,11 +3232,10 @@ ex_listdo(exarg_T *eap)
if (eap->cmdidx == CMD_windo) if (eap->cmdidx == CMD_windo)
{ {
validate_cursor(); /* cursor may have moved */ validate_cursor(); /* cursor may have moved */
#ifdef FEAT_SCROLLBIND
/* required when 'scrollbind' has been set */ /* required when 'scrollbind' has been set */
if (curwin->w_p_scb) if (curwin->w_p_scb)
do_check_scrollbind(TRUE); do_check_scrollbind(TRUE);
#endif
} }
if (eap->cmdidx == CMD_windo || eap->cmdidx == CMD_tabdo) if (eap->cmdidx == CMD_windo || eap->cmdidx == CMD_tabdo)

View File

@@ -8263,20 +8263,18 @@ ex_splitview(exarg_T *eap)
else if (win_split(eap->addr_count > 0 ? (int)eap->line2 : 0, else if (win_split(eap->addr_count > 0 ? (int)eap->line2 : 0,
*eap->cmd == 'v' ? WSP_VERT : 0) != FAIL) *eap->cmd == 'v' ? WSP_VERT : 0) != FAIL)
{ {
# ifdef FEAT_SCROLLBIND
/* Reset 'scrollbind' when editing another file, but keep it when /* Reset 'scrollbind' when editing another file, but keep it when
* doing ":split" without arguments. */ * doing ":split" without arguments. */
if (*eap->arg != NUL if (*eap->arg != NUL
# ifdef FEAT_BROWSE # ifdef FEAT_BROWSE
|| cmdmod.browse || cmdmod.browse
# endif # endif
) )
{ {
RESET_BINDING(curwin); RESET_BINDING(curwin);
} }
else else
do_check_scrollbind(FALSE); do_check_scrollbind(FALSE);
# endif
do_exedit(eap, old_curwin); do_exedit(eap, old_curwin);
} }
@@ -8768,7 +8766,6 @@ ex_swapname(exarg_T *eap UNUSED)
static void static void
ex_syncbind(exarg_T *eap UNUSED) ex_syncbind(exarg_T *eap UNUSED)
{ {
#ifdef FEAT_SCROLLBIND
win_T *wp; win_T *wp;
win_T *save_curwin = curwin; win_T *save_curwin = curwin;
buf_T *save_curbuf = curbuf; buf_T *save_curbuf = curbuf;
@@ -8836,7 +8833,6 @@ ex_syncbind(exarg_T *eap UNUSED)
ins_typebuf(ctrl_o, REMAP_NONE, 0, TRUE, FALSE); ins_typebuf(ctrl_o, REMAP_NONE, 0, TRUE, FALSE);
} }
} }
#endif
} }

View File

@@ -728,7 +728,6 @@ EXTERN colnr_T ai_col INIT(= 0);
EXTERN int end_comment_pending INIT(= NUL); EXTERN int end_comment_pending INIT(= NUL);
#endif #endif
#ifdef FEAT_SCROLLBIND
/* /*
* This flag is set after a ":syncbind" to let the check_scrollbind() function * This flag is set after a ":syncbind" to let the check_scrollbind() function
* know that it should not attempt to perform scrollbinding due to the scroll * know that it should not attempt to perform scrollbinding due to the scroll
@@ -736,7 +735,6 @@ EXTERN int end_comment_pending INIT(= NUL);
* undo some of the work done by ":syncbind.") -ralston * undo some of the work done by ":syncbind.") -ralston
*/ */
EXTERN int did_syncbind INIT(= FALSE); EXTERN int did_syncbind INIT(= FALSE);
#endif
#ifdef FEAT_SMARTINDENT #ifdef FEAT_SMARTINDENT
/* /*

View File

@@ -3959,9 +3959,7 @@ gui_drag_scrollbar(scrollbar_T *sb, long value, int still_dragging)
int sb_num; int sb_num;
#ifdef USE_ON_FLY_SCROLL #ifdef USE_ON_FLY_SCROLL
colnr_T old_leftcol = curwin->w_leftcol; colnr_T old_leftcol = curwin->w_leftcol;
# ifdef FEAT_SCROLLBIND
linenr_T old_topline = curwin->w_topline; linenr_T old_topline = curwin->w_topline;
# endif
# ifdef FEAT_DIFF # ifdef FEAT_DIFF
int old_topfill = curwin->w_topfill; int old_topfill = curwin->w_topfill;
# endif # endif
@@ -4126,16 +4124,15 @@ gui_drag_scrollbar(scrollbar_T *sb, long value, int still_dragging)
} }
#ifdef USE_ON_FLY_SCROLL #ifdef USE_ON_FLY_SCROLL
# ifdef FEAT_SCROLLBIND
/* /*
* synchronize other windows, as necessary according to 'scrollbind' * synchronize other windows, as necessary according to 'scrollbind'
*/ */
if (curwin->w_p_scb if (curwin->w_p_scb
&& ((sb->wp == NULL && curwin->w_leftcol != old_leftcol) && ((sb->wp == NULL && curwin->w_leftcol != old_leftcol)
|| (sb->wp == curwin && (curwin->w_topline != old_topline || (sb->wp == curwin && (curwin->w_topline != old_topline
# ifdef FEAT_DIFF # ifdef FEAT_DIFF
|| curwin->w_topfill != old_topfill || curwin->w_topfill != old_topfill
# endif # endif
)))) ))))
{ {
do_check_scrollbind(TRUE); do_check_scrollbind(TRUE);
@@ -4145,7 +4142,6 @@ gui_drag_scrollbar(scrollbar_T *sb, long value, int still_dragging)
updateWindow(wp); updateWindow(wp);
setcursor(); setcursor();
} }
# endif
out_flush_cursor(FALSE, TRUE); out_flush_cursor(FALSE, TRUE);
#else #else
add_to_input_buf(bytes, byte_count); add_to_input_buf(bytes, byte_count);
@@ -4474,9 +4470,7 @@ gui_do_scroll(void)
} }
if (old_cursor.lnum != wp->w_cursor.lnum) if (old_cursor.lnum != wp->w_cursor.lnum)
coladvance(wp->w_curswant); coladvance(wp->w_curswant);
#ifdef FEAT_SCROLLBIND
wp->w_scbind_pos = wp->w_topline; wp->w_scbind_pos = wp->w_topline;
#endif
} }
/* Make sure wp->w_leftcol and wp->w_skipcol are correct. */ /* Make sure wp->w_leftcol and wp->w_skipcol are correct. */

View File

@@ -294,19 +294,7 @@
# define DO_AUTOCHDIR # define DO_AUTOCHDIR
#endif #endif
#if defined(FEAT_SCROLLBIND) && defined(FEAT_CURSORBIND) #define RESET_BINDING(wp) (wp)->w_p_scb = FALSE; (wp)->w_p_crb = FALSE
# define RESET_BINDING(wp) (wp)->w_p_scb = FALSE; (wp)->w_p_crb = FALSE
#else
# if defined(FEAT_SCROLLBIND)
# define RESET_BINDING(wp) (wp)->w_p_scb = FALSE
# else
# if defined(FEAT_CURSORBIND)
# define RESET_BINDING(wp) (wp)->w_p_crb = FALSE
# else
# define RESET_BINDING(wp)
# endif
# endif
#endif
#ifdef FEAT_DIFF #ifdef FEAT_DIFF
# define PLINES_NOFILL(x) plines_nofill(x) # define PLINES_NOFILL(x) plines_nofill(x)

View File

@@ -857,7 +857,7 @@ vim_main2(void)
} }
#endif #endif
#if defined(FEAT_DIFF) && defined(FEAT_SCROLLBIND) #if defined(FEAT_DIFF)
/* When a startup script or session file setup for diff'ing and /* When a startup script or session file setup for diff'ing and
* scrollbind, sync the scrollbind now. */ * scrollbind, sync the scrollbind now. */
if (curwin->w_p_diff && curwin->w_p_scb) if (curwin->w_p_diff && curwin->w_p_scb)
@@ -1193,7 +1193,7 @@ main_loop(
curbuf->b_last_changedtick = CHANGEDTICK(curbuf); curbuf->b_last_changedtick = CHANGEDTICK(curbuf);
} }
#if defined(FEAT_DIFF) && defined(FEAT_SCROLLBIND) #if defined(FEAT_DIFF)
/* Scroll-binding for diff mode may have been postponed until /* Scroll-binding for diff mode may have been postponed until
* here. Avoids doing it for every change. */ * here. Avoids doing it for every change. */
if (diff_need_scrollbind) if (diff_need_scrollbind)

View File

@@ -184,9 +184,7 @@ update_topline(void)
curwin->w_topline = curwin->w_cursor.lnum; curwin->w_topline = curwin->w_cursor.lnum;
curwin->w_botline = curwin->w_topline; curwin->w_botline = curwin->w_topline;
curwin->w_valid |= VALID_BOTLINE|VALID_BOTLINE_AP; curwin->w_valid |= VALID_BOTLINE|VALID_BOTLINE_AP;
#ifdef FEAT_SCROLLBIND
curwin->w_scbind_pos = 1; curwin->w_scbind_pos = 1;
#endif
return; return;
} }
@@ -215,9 +213,7 @@ update_topline(void)
curwin->w_topline = 1; curwin->w_topline = 1;
curwin->w_botline = 2; curwin->w_botline = 2;
curwin->w_valid |= VALID_BOTLINE|VALID_BOTLINE_AP; curwin->w_valid |= VALID_BOTLINE|VALID_BOTLINE_AP;
#ifdef FEAT_SCROLLBIND
curwin->w_scbind_pos = 1; curwin->w_scbind_pos = 1;
#endif
} }
/* /*
@@ -2773,7 +2769,6 @@ halfpage(int flag, linenr_T Prenum)
redraw_later(VALID); redraw_later(VALID);
} }
#if defined(FEAT_CURSORBIND) || defined(PROTO)
void void
do_check_cursorbind(void) do_check_cursorbind(void)
{ {
@@ -2846,4 +2841,3 @@ do_check_cursorbind(void)
curwin = old_curwin; curwin = old_curwin;
curbuf = old_curbuf; curbuf = old_curbuf;
} }
#endif /* FEAT_CURSORBIND */

View File

@@ -1275,21 +1275,17 @@ normal_end:
mb_adjust_cursor(); mb_adjust_cursor();
#endif #endif
#ifdef FEAT_SCROLLBIND
if (curwin->w_p_scb && toplevel) if (curwin->w_p_scb && toplevel)
{ {
validate_cursor(); /* may need to update w_leftcol */ validate_cursor(); /* may need to update w_leftcol */
do_check_scrollbind(TRUE); do_check_scrollbind(TRUE);
} }
#endif
#ifdef FEAT_CURSORBIND
if (curwin->w_p_crb && toplevel) if (curwin->w_p_crb && toplevel)
{ {
validate_cursor(); /* may need to update w_leftcol */ validate_cursor(); /* may need to update w_leftcol */
do_check_cursorbind(); do_check_cursorbind();
} }
#endif
#ifdef FEAT_TERMINAL #ifdef FEAT_TERMINAL
/* don't go to Insert mode if a terminal has a running job */ /* don't go to Insert mode if a terminal has a running job */
@@ -3980,7 +3976,6 @@ display_showcmd(void)
} }
#endif #endif
#ifdef FEAT_SCROLLBIND
/* /*
* When "check" is FALSE, prepare for commands that scroll the window. * When "check" is FALSE, prepare for commands that scroll the window.
* When "check" is TRUE, take care of scroll-binding after the window has * When "check" is TRUE, take care of scroll-binding after the window has
@@ -4139,7 +4134,6 @@ check_scrollbind(linenr_T topline_diff, long leftcol_diff)
curwin = old_curwin; curwin = old_curwin;
curbuf = old_curbuf; curbuf = old_curbuf;
} }
#endif /* #ifdef FEAT_SCROLLBIND */
/* /*
* Command character that's ignored. * Command character that's ignored.

View File

@@ -227,9 +227,7 @@
# define PV_RL OPT_WIN(WV_RL) # define PV_RL OPT_WIN(WV_RL)
# define PV_RLC OPT_WIN(WV_RLC) # define PV_RLC OPT_WIN(WV_RLC)
#endif #endif
#ifdef FEAT_SCROLLBIND #define PV_SCBIND OPT_WIN(WV_SCBIND)
# define PV_SCBIND OPT_WIN(WV_SCBIND)
#endif
#define PV_SCROLL OPT_WIN(WV_SCROLL) #define PV_SCROLL OPT_WIN(WV_SCROLL)
#ifdef FEAT_SPELL #ifdef FEAT_SPELL
# define PV_SPELL OPT_WIN(WV_SPELL) # define PV_SPELL OPT_WIN(WV_SPELL)
@@ -246,9 +244,7 @@
# define PV_WFH OPT_WIN(WV_WFH) # define PV_WFH OPT_WIN(WV_WFH)
# define PV_WFW OPT_WIN(WV_WFW) # define PV_WFW OPT_WIN(WV_WFW)
#define PV_WRAP OPT_WIN(WV_WRAP) #define PV_WRAP OPT_WIN(WV_WRAP)
#ifdef FEAT_CURSORBIND #define PV_CRBIND OPT_WIN(WV_CRBIND)
# define PV_CRBIND OPT_WIN(WV_CRBIND)
#endif
#ifdef FEAT_CONCEAL #ifdef FEAT_CONCEAL
# define PV_COCU OPT_WIN(WV_COCU) # define PV_COCU OPT_WIN(WV_COCU)
# define PV_COLE OPT_WIN(WV_COLE) # define PV_COLE OPT_WIN(WV_COLE)
@@ -976,11 +972,7 @@ static struct vimoption options[] =
#endif #endif
{(char_u *)0L, (char_u *)0L} SCRIPTID_INIT}, {(char_u *)0L, (char_u *)0L} SCRIPTID_INIT},
{"cursorbind", "crb", P_BOOL|P_VI_DEF, {"cursorbind", "crb", P_BOOL|P_VI_DEF,
#ifdef FEAT_CURSORBIND
(char_u *)VAR_WIN, PV_CRBIND, (char_u *)VAR_WIN, PV_CRBIND,
#else
(char_u *)NULL, PV_NONE,
#endif
{(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT}, {(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT},
{"cursorcolumn", "cuc", P_BOOL|P_VI_DEF|P_RWIN, {"cursorcolumn", "cuc", P_BOOL|P_VI_DEF|P_RWIN,
#ifdef FEAT_SYN_HL #ifdef FEAT_SYN_HL
@@ -2382,11 +2374,7 @@ static struct vimoption options[] =
(char_u *)VAR_WIN, PV_SCROLL, (char_u *)VAR_WIN, PV_SCROLL,
{(char_u *)0L, (char_u *)0L} SCRIPTID_INIT}, {(char_u *)0L, (char_u *)0L} SCRIPTID_INIT},
{"scrollbind", "scb", P_BOOL|P_VI_DEF, {"scrollbind", "scb", P_BOOL|P_VI_DEF,
#ifdef FEAT_SCROLLBIND
(char_u *)VAR_WIN, PV_SCBIND, (char_u *)VAR_WIN, PV_SCBIND,
#else
(char_u *)NULL, PV_NONE,
#endif
{(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT}, {(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT},
{"scrolljump", "sj", P_NUM|P_VI_DEF|P_VIM, {"scrolljump", "sj", P_NUM|P_VI_DEF|P_VIM,
(char_u *)&p_sj, PV_NONE, (char_u *)&p_sj, PV_NONE,
@@ -2395,13 +2383,8 @@ static struct vimoption options[] =
(char_u *)&p_so, PV_NONE, (char_u *)&p_so, PV_NONE,
{(char_u *)0L, (char_u *)0L} SCRIPTID_INIT}, {(char_u *)0L, (char_u *)0L} SCRIPTID_INIT},
{"scrollopt", "sbo", P_STRING|P_VI_DEF|P_ONECOMMA|P_NODUP, {"scrollopt", "sbo", P_STRING|P_VI_DEF|P_ONECOMMA|P_NODUP,
#ifdef FEAT_SCROLLBIND
(char_u *)&p_sbo, PV_NONE, (char_u *)&p_sbo, PV_NONE,
{(char_u *)"ver,jump", (char_u *)0L} {(char_u *)"ver,jump", (char_u *)0L}
#else
(char_u *)NULL, PV_NONE,
{(char_u *)0L, (char_u *)0L}
#endif
SCRIPTID_INIT}, SCRIPTID_INIT},
{"sections", "sect", P_STRING|P_VI_DEF, {"sections", "sect", P_STRING|P_VI_DEF,
(char_u *)&p_sections, PV_NONE, (char_u *)&p_sections, PV_NONE,
@@ -3230,9 +3213,7 @@ static char *(p_km_values[]) = {"startsel", "stopsel", NULL};
#ifdef FEAT_BROWSE #ifdef FEAT_BROWSE
static char *(p_bsdir_values[]) = {"current", "last", "buffer", NULL}; static char *(p_bsdir_values[]) = {"current", "last", "buffer", NULL};
#endif #endif
#ifdef FEAT_SCROLLBIND
static char *(p_scbopt_values[]) = {"ver", "hor", "jump", NULL}; static char *(p_scbopt_values[]) = {"ver", "hor", "jump", NULL};
#endif
static char *(p_debug_values[]) = {"msg", "throw", "beep", NULL}; static char *(p_debug_values[]) = {"msg", "throw", "beep", NULL};
static char *(p_ead_values[]) = {"both", "ver", "hor", NULL}; static char *(p_ead_values[]) = {"both", "ver", "hor", NULL};
static char *(p_buftype_values[]) = {"nofile", "nowrite", "quickfix", "help", "terminal", "acwrite", NULL}; static char *(p_buftype_values[]) = {"nofile", "nowrite", "quickfix", "help", "terminal", "acwrite", NULL};
@@ -6240,13 +6221,11 @@ did_set_string_option(
#endif #endif
/* 'scrollopt' */ /* 'scrollopt' */
#ifdef FEAT_SCROLLBIND
else if (varp == &p_sbo) else if (varp == &p_sbo)
{ {
if (check_opt_strings(p_sbo, p_scbopt_values, TRUE) != OK) if (check_opt_strings(p_sbo, p_scbopt_values, TRUE) != OK)
errmsg = e_invarg; errmsg = e_invarg;
} }
#endif
/* 'ambiwidth' */ /* 'ambiwidth' */
#ifdef FEAT_MBYTE #ifdef FEAT_MBYTE
@@ -8328,7 +8307,6 @@ set_bool_option(
} }
#endif #endif
#ifdef FEAT_SCROLLBIND
/* when 'scrollbind' is set: snapshot the current position to avoid a jump /* when 'scrollbind' is set: snapshot the current position to avoid a jump
* at the end of normal_cmd() */ * at the end of normal_cmd() */
else if ((int *)varp == &curwin->w_p_scb) else if ((int *)varp == &curwin->w_p_scb)
@@ -8339,7 +8317,6 @@ set_bool_option(
curwin->w_scbind_pos = curwin->w_topline; curwin->w_scbind_pos = curwin->w_topline;
} }
} }
#endif
#if defined(FEAT_QUICKFIX) #if defined(FEAT_QUICKFIX)
/* There can be only one window with 'previewwindow' set. */ /* There can be only one window with 'previewwindow' set. */
@@ -10688,12 +10665,8 @@ get_varp(struct vimoption *p)
case PV_BRI: return (char_u *)&(curwin->w_p_bri); case PV_BRI: return (char_u *)&(curwin->w_p_bri);
case PV_BRIOPT: return (char_u *)&(curwin->w_p_briopt); case PV_BRIOPT: return (char_u *)&(curwin->w_p_briopt);
#endif #endif
#ifdef FEAT_SCROLLBIND
case PV_SCBIND: return (char_u *)&(curwin->w_p_scb); case PV_SCBIND: return (char_u *)&(curwin->w_p_scb);
#endif
#ifdef FEAT_CURSORBIND
case PV_CRBIND: return (char_u *)&(curwin->w_p_crb); case PV_CRBIND: return (char_u *)&(curwin->w_p_crb);
#endif
#ifdef FEAT_CONCEAL #ifdef FEAT_CONCEAL
case PV_COCU: return (char_u *)&(curwin->w_p_cocu); case PV_COCU: return (char_u *)&(curwin->w_p_cocu);
case PV_COLE: return (char_u *)&(curwin->w_p_cole); case PV_COLE: return (char_u *)&(curwin->w_p_cole);
@@ -10878,14 +10851,10 @@ copy_winopt(winopt_T *from, winopt_T *to)
to->wo_bri = from->wo_bri; to->wo_bri = from->wo_bri;
to->wo_briopt = vim_strsave(from->wo_briopt); to->wo_briopt = vim_strsave(from->wo_briopt);
#endif #endif
#ifdef FEAT_SCROLLBIND
to->wo_scb = from->wo_scb; to->wo_scb = from->wo_scb;
to->wo_scb_save = from->wo_scb_save; to->wo_scb_save = from->wo_scb_save;
#endif
#ifdef FEAT_CURSORBIND
to->wo_crb = from->wo_crb; to->wo_crb = from->wo_crb;
to->wo_crb_save = from->wo_crb_save; to->wo_crb_save = from->wo_crb_save;
#endif
#ifdef FEAT_SPELL #ifdef FEAT_SPELL
to->wo_spell = from->wo_spell; to->wo_spell = from->wo_spell;
#endif #endif

View File

@@ -739,9 +739,7 @@ EXTERN char_u *p_pp; /* 'packpath' */
EXTERN char_u *p_rtp; /* 'runtimepath' */ EXTERN char_u *p_rtp; /* 'runtimepath' */
EXTERN long p_sj; /* 'scrolljump' */ EXTERN long p_sj; /* 'scrolljump' */
EXTERN long p_so; /* 'scrolloff' */ EXTERN long p_so; /* 'scrolloff' */
#ifdef FEAT_SCROLLBIND
EXTERN char_u *p_sbo; /* 'scrollopt' */ EXTERN char_u *p_sbo; /* 'scrollopt' */
#endif
EXTERN char_u *p_sections; /* 'sections' */ EXTERN char_u *p_sections; /* 'sections' */
EXTERN int p_secure; /* 'secure' */ EXTERN int p_secure; /* 'secure' */
EXTERN char_u *p_sel; /* 'selection' */ EXTERN char_u *p_sel; /* 'selection' */
@@ -1133,9 +1131,7 @@ enum
, WV_TK , WV_TK
, WV_TMS , WV_TMS
#endif #endif
#ifdef FEAT_CURSORBIND
, WV_CRBIND , WV_CRBIND
#endif
#ifdef FEAT_LINEBREAK #ifdef FEAT_LINEBREAK
, WV_BRI , WV_BRI
, WV_BRIOPT , WV_BRIOPT
@@ -1172,9 +1168,7 @@ enum
, WV_RL , WV_RL
, WV_RLC , WV_RLC
#endif #endif
#ifdef FEAT_SCROLLBIND
, WV_SCBIND , WV_SCBIND
#endif
, WV_SCROLL , WV_SCROLL
#ifdef FEAT_SPELL #ifdef FEAT_SPELL
, WV_SPELL , WV_SPELL

View File

@@ -244,14 +244,12 @@ typedef struct
char_u *wo_stl; char_u *wo_stl;
#define w_p_stl w_onebuf_opt.wo_stl /* 'statusline' */ #define w_p_stl w_onebuf_opt.wo_stl /* 'statusline' */
#endif #endif
#ifdef FEAT_SCROLLBIND
int wo_scb; int wo_scb;
# define w_p_scb w_onebuf_opt.wo_scb /* 'scrollbind' */ #define w_p_scb w_onebuf_opt.wo_scb /* 'scrollbind' */
int wo_diff_saved; /* options were saved for starting diff mode */ int wo_diff_saved; /* options were saved for starting diff mode */
# define w_p_diff_saved w_onebuf_opt.wo_diff_saved #define w_p_diff_saved w_onebuf_opt.wo_diff_saved
int wo_scb_save; /* 'scrollbind' saved for diff mode*/ int wo_scb_save; /* 'scrollbind' saved for diff mode*/
# define w_p_scb_save w_onebuf_opt.wo_scb_save #define w_p_scb_save w_onebuf_opt.wo_scb_save
#endif
int wo_wrap; int wo_wrap;
#define w_p_wrap w_onebuf_opt.wo_wrap /* 'wrap' */ #define w_p_wrap w_onebuf_opt.wo_wrap /* 'wrap' */
#ifdef FEAT_DIFF #ifdef FEAT_DIFF
@@ -264,12 +262,10 @@ typedef struct
long wo_cole; /* 'conceallevel' */ long wo_cole; /* 'conceallevel' */
# define w_p_cole w_onebuf_opt.wo_cole # define w_p_cole w_onebuf_opt.wo_cole
#endif #endif
#ifdef FEAT_CURSORBIND
int wo_crb; int wo_crb;
# define w_p_crb w_onebuf_opt.wo_crb /* 'cursorbind' */ #define w_p_crb w_onebuf_opt.wo_crb /* 'cursorbind' */
int wo_crb_save; /* 'cursorbind' state saved for diff mode*/ int wo_crb_save; /* 'cursorbind' state saved for diff mode*/
# define w_p_crb_save w_onebuf_opt.wo_crb_save #define w_p_crb_save w_onebuf_opt.wo_crb_save
#endif
#ifdef FEAT_SIGNS #ifdef FEAT_SIGNS
char_u *wo_scl; char_u *wo_scl;
# define w_p_scl w_onebuf_opt.wo_scl /* 'signcolumn' */ # define w_p_scl w_onebuf_opt.wo_scl /* 'signcolumn' */
@@ -2829,9 +2825,7 @@ struct window_S
/* transform a pointer to a "onebuf" option into a "allbuf" option */ /* transform a pointer to a "onebuf" option into a "allbuf" option */
#define GLOBAL_WO(p) ((char *)p + sizeof(winopt_T)) #define GLOBAL_WO(p) ((char *)p + sizeof(winopt_T))
#ifdef FEAT_SCROLLBIND
long w_scbind_pos; long w_scbind_pos;
#endif
#ifdef FEAT_EVAL #ifdef FEAT_EVAL
dictitem_T w_winvar; /* variable for "w:" Dictionary */ dictitem_T w_winvar; /* variable for "w:" Dictionary */

View File

@@ -3297,10 +3297,8 @@ set_shellsize(int width, int height, int mustset)
} }
else else
{ {
#ifdef FEAT_SCROLLBIND
if (curwin->w_p_scb) if (curwin->w_p_scb)
do_check_scrollbind(TRUE); do_check_scrollbind(TRUE);
#endif
if (State & CMDLINE) if (State & CMDLINE)
{ {
update_screen(NOT_VALID); update_screen(NOT_VALID);

View File

@@ -168,11 +168,7 @@ static char *(features[]) =
#else #else
"-cscope", "-cscope",
#endif #endif
#ifdef FEAT_CURSORBIND
"+cursorbind", "+cursorbind",
#else
"-cursorbind",
#endif
#ifdef CURSOR_SHAPE #ifdef CURSOR_SHAPE
"+cursorshape", "+cursorshape",
#else #else
@@ -556,11 +552,7 @@ static char *(features[]) =
#else #else
"-ruby", "-ruby",
#endif #endif
#ifdef FEAT_SCROLLBIND
"+scrollbind", "+scrollbind",
#else
"-scrollbind",
#endif
#ifdef FEAT_SIGNS #ifdef FEAT_SIGNS
"+signs", "+signs",
#else #else
@@ -774,6 +766,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
1566,
/**/ /**/
1565, 1565,
/**/ /**/

View File

@@ -4498,9 +4498,7 @@ win_alloc(win_T *after UNUSED, int hidden UNUSED)
#endif #endif
new_wp->w_botline = 2; new_wp->w_botline = 2;
new_wp->w_cursor.lnum = 1; new_wp->w_cursor.lnum = 1;
#ifdef FEAT_SCROLLBIND
new_wp->w_scbind_pos = 1; new_wp->w_scbind_pos = 1;
#endif
/* We won't calculate w_fraction until resizing the window */ /* We won't calculate w_fraction until resizing the window */
new_wp->w_fraction = 0; new_wp->w_fraction = 0;
@@ -5659,11 +5657,7 @@ scroll_to_fraction(win_T *wp, int prev_height)
/* Don't change w_topline when height is zero. Don't set w_topline when /* Don't change w_topline when height is zero. Don't set w_topline when
* 'scrollbind' is set and this isn't the current window. */ * 'scrollbind' is set and this isn't the current window. */
if (height > 0 if (height > 0 && (!wp->w_p_scb || wp == curwin))
#ifdef FEAT_SCROLLBIND
&& (!wp->w_p_scb || wp == curwin)
#endif
)
{ {
/* /*
* Find a value for w_topline that shows the cursor at the same * Find a value for w_topline that shows the cursor at the same