]> granicus.if.org Git - vim/commitdiff
patch 8.0.1566: too many #ifdefs v8.0.1566
authorBram Moolenaar <Bram@vim.org>
Sun, 4 Mar 2018 19:14:14 +0000 (20:14 +0100)
committerBram Moolenaar <Bram@vim.org>
Sun, 4 Mar 2018 19:14:14 +0000 (20:14 +0100)
Problem:    Too many #ifdefs.
Solution:   Graduate FEAT_SCROLLBIND and FEAT_CURSORBIND.

19 files changed:
src/buffer.c
src/diff.c
src/edit.c
src/evalfunc.c
src/ex_cmds.c
src/ex_cmds2.c
src/ex_docmd.c
src/globals.h
src/gui.c
src/macros.h
src/main.c
src/move.c
src/normal.c
src/option.c
src/option.h
src/structs.h
src/term.c
src/version.c
src/window.c

index 3285577412fc518e8c1c7d01a91ac46d38ad5415..b292150a2e677e148b8f2d9d849e3b882a69a87b 100644 (file)
@@ -1583,8 +1583,7 @@ do_buffer(
     /* Go to the other buffer. */
     set_curbuf(buf, action);
 
-#if defined(FEAT_LISTCMDS) \
-       && (defined(FEAT_SCROLLBIND) || defined(FEAT_CURSORBIND))
+#if defined(FEAT_LISTCMDS)
     if (action == DOBUF_SPLIT)
     {
        RESET_BINDING(curwin);  /* reset 'scrollbind' and 'cursorbind' */
index 6f3c99b9ad80d889a249391b8f36f58725aed668..b69b69e31da07efdf3a66fcd00d1ab162a04db84 100644 (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
 }
 
 /*
index e20857df6d8ddf6e900cdd3a3c1fbf50588c21f7..423ccea449a9b963a7de35b46f22c61db7cfc75d 100644 (file)
@@ -764,15 +764,11 @@ edit(
         */
        ins_redraw(TRUE);
 
-#ifdef FEAT_SCROLLBIND
        if (curwin->w_p_scb)
            do_check_scrollbind(TRUE);
-#endif
 
-#ifdef FEAT_CURSORBIND
        if (curwin->w_p_crb)
            do_check_cursorbind();
-#endif
        update_curswant();
        old_topline = curwin->w_topline;
 #ifdef FEAT_DIFF
index 48eac573773870ba0f6a8d9b48de1a0e40c1727f..9cbdf3f0b7bf35541f42ce7d3a2d25163eff4fac 100644 (file)
@@ -5852,9 +5852,7 @@ f_has(typval_T *argvars, typval_T *rettv)
 #ifdef FEAT_CSCOPE
        "cscope",
 #endif
-#ifdef FEAT_CURSORBIND
        "cursorbind",
-#endif
 #ifdef CURSOR_SHAPE
        "cursorshape",
 #endif
@@ -6104,9 +6102,7 @@ f_has(typval_T *argvars, typval_T *rettv)
 #if defined(FEAT_RUBY) && !defined(DYNAMIC_RUBY)
        "ruby",
 #endif
-#ifdef FEAT_SCROLLBIND
        "scrollbind",
-#endif
 #ifdef FEAT_CMDL_INFO
        "showcmd",
        "cmdline_info",
index 23930ca2a0c016093dc72244c3f1e9c80d64c3dc..6845be57d8f1e864502c7ec5cafda5f56a6372aa 100644 (file)
@@ -4318,9 +4318,7 @@ do_ecmd(
        if (topline == 0 && command == NULL)
            p_so = 999;                 /* force cursor halfway the window */
        update_topline();
-#ifdef FEAT_SCROLLBIND
        curwin->w_scbind_pos = curwin->w_topline;
-#endif
        p_so = n;
        redraw_curbuf_later(NOT_VALID); /* redraw this buffer later */
     }
@@ -5270,10 +5268,8 @@ do_sub(exarg_T *eap)
                    setmouse();         /* disable mouse in xterm */
 #endif
                    curwin->w_cursor.col = regmatch.startpos[0].col;
-#ifdef FEAT_CURSORBIND
                    if (curwin->w_p_crb)
                        do_check_cursorbind();
-#endif
 
                    /* When 'cpoptions' contains "u" don't sync undo when
                     * asking for confirmation. */
index b1f80f9b91e2142d3a84d00a1192e0aa2c9281e1..424bac8c737844f618f44d19dc22175cad69d8e7 100644 (file)
@@ -3232,11 +3232,10 @@ ex_listdo(exarg_T *eap)
            if (eap->cmdidx == CMD_windo)
            {
                validate_cursor();      /* cursor may have moved */
-#ifdef FEAT_SCROLLBIND
+
                /* required when 'scrollbind' has been set */
                if (curwin->w_p_scb)
                    do_check_scrollbind(TRUE);
-#endif
            }
 
            if (eap->cmdidx == CMD_windo || eap->cmdidx == CMD_tabdo)
index c0eed2d5f46a40d4df4f8587a34a64d808f91d57..0a51d8eb7da4513a8f42176ce9019912709ac794 100644 (file)
@@ -8263,20 +8263,18 @@ ex_splitview(exarg_T *eap)
     else if (win_split(eap->addr_count > 0 ? (int)eap->line2 : 0,
                                     *eap->cmd == 'v' ? WSP_VERT : 0) != FAIL)
     {
-# ifdef FEAT_SCROLLBIND
        /* Reset 'scrollbind' when editing another file, but keep it when
         * doing ":split" without arguments. */
        if (*eap->arg != NUL
-#  ifdef FEAT_BROWSE
+# ifdef FEAT_BROWSE
                || cmdmod.browse
-#  endif
+# endif
           )
        {
            RESET_BINDING(curwin);
        }
        else
            do_check_scrollbind(FALSE);
-# endif
        do_exedit(eap, old_curwin);
     }
 
@@ -8768,7 +8766,6 @@ ex_swapname(exarg_T *eap UNUSED)
     static void
 ex_syncbind(exarg_T *eap UNUSED)
 {
-#ifdef FEAT_SCROLLBIND
     win_T      *wp;
     win_T      *save_curwin = curwin;
     buf_T      *save_curbuf = curbuf;
@@ -8836,7 +8833,6 @@ ex_syncbind(exarg_T *eap UNUSED)
            ins_typebuf(ctrl_o, REMAP_NONE, 0, TRUE, FALSE);
        }
     }
-#endif
 }
 
 
index c62e96a2c9a2715f5ea95945d85568c8f74ea6f8..d5320d7272dd6801bcdc36d0c73e836579fae96b 100644 (file)
@@ -728,7 +728,6 @@ EXTERN colnr_T      ai_col INIT(= 0);
 EXTERN int     end_comment_pending INIT(= NUL);
 #endif
 
-#ifdef FEAT_SCROLLBIND
 /*
  * 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
@@ -736,7 +735,6 @@ EXTERN int     end_comment_pending INIT(= NUL);
  * undo some of the work done by ":syncbind.")  -ralston
  */
 EXTERN int     did_syncbind INIT(= FALSE);
-#endif
 
 #ifdef FEAT_SMARTINDENT
 /*
index 607a8fd2a5fd433a3e99ad9a14d8938ee3d1e979..eac4fae6850a60be5e40f1926a11819b054235b1 100644 (file)
--- a/src/gui.c
+++ b/src/gui.c
@@ -3959,9 +3959,7 @@ gui_drag_scrollbar(scrollbar_T *sb, long value, int still_dragging)
     int                sb_num;
 #ifdef USE_ON_FLY_SCROLL
     colnr_T    old_leftcol = curwin->w_leftcol;
-# ifdef FEAT_SCROLLBIND
     linenr_T   old_topline = curwin->w_topline;
-# endif
 # ifdef FEAT_DIFF
     int                old_topfill = curwin->w_topfill;
 # endif
@@ -4126,16 +4124,15 @@ gui_drag_scrollbar(scrollbar_T *sb, long value, int still_dragging)
     }
 
 #ifdef USE_ON_FLY_SCROLL
-# ifdef FEAT_SCROLLBIND
     /*
      * synchronize other windows, as necessary according to 'scrollbind'
      */
     if (curwin->w_p_scb
            && ((sb->wp == NULL && curwin->w_leftcol != old_leftcol)
                || (sb->wp == curwin && (curwin->w_topline != old_topline
-#  ifdef FEAT_DIFF
+# ifdef FEAT_DIFF
                                           || curwin->w_topfill != old_topfill
-#  endif
+# endif
                        ))))
     {
        do_check_scrollbind(TRUE);
@@ -4145,7 +4142,6 @@ gui_drag_scrollbar(scrollbar_T *sb, long value, int still_dragging)
                updateWindow(wp);
        setcursor();
     }
-# endif
     out_flush_cursor(FALSE, TRUE);
 #else
     add_to_input_buf(bytes, byte_count);
@@ -4474,9 +4470,7 @@ gui_do_scroll(void)
        }
        if (old_cursor.lnum != wp->w_cursor.lnum)
            coladvance(wp->w_curswant);
-#ifdef FEAT_SCROLLBIND
        wp->w_scbind_pos = wp->w_topline;
-#endif
     }
 
     /* Make sure wp->w_leftcol and wp->w_skipcol are correct. */
index 43d6c94cf05a3dcf89a5d64f4563b324b393e2c5..f5440b17e051cb221eb07868fac5f33381c526c8 100644 (file)
 # define DO_AUTOCHDIR
 #endif
 
-#if defined(FEAT_SCROLLBIND) && defined(FEAT_CURSORBIND)
-# 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
+#define RESET_BINDING(wp)  (wp)->w_p_scb = FALSE; (wp)->w_p_crb = FALSE
 
 #ifdef FEAT_DIFF
 # define PLINES_NOFILL(x) plines_nofill(x)
index 406635a166fec6f68e06f54857f3a6a0328d615b..ff01fd968fe7eb3e863a74b4b3aaf6866102f165 100644 (file)
@@ -857,7 +857,7 @@ vim_main2(void)
     }
 #endif
 
-#if defined(FEAT_DIFF) && defined(FEAT_SCROLLBIND)
+#if defined(FEAT_DIFF)
     /* When a startup script or session file setup for diff'ing and
      * scrollbind, sync the scrollbind now. */
     if (curwin->w_p_diff && curwin->w_p_scb)
@@ -1193,7 +1193,7 @@ main_loop(
                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
             * here.  Avoids doing it for every change. */
            if (diff_need_scrollbind)
index 45f7be4edf3b040df44fc4284b4d9d022e52cfe7..a56003013c68009742b04c320a42b23b84cea7b0 100644 (file)
@@ -184,9 +184,7 @@ update_topline(void)
        curwin->w_topline = curwin->w_cursor.lnum;
        curwin->w_botline = curwin->w_topline;
        curwin->w_valid |= VALID_BOTLINE|VALID_BOTLINE_AP;
-#ifdef FEAT_SCROLLBIND
        curwin->w_scbind_pos = 1;
-#endif
        return;
     }
 
@@ -215,9 +213,7 @@ update_topline(void)
        curwin->w_topline = 1;
        curwin->w_botline = 2;
        curwin->w_valid |= VALID_BOTLINE|VALID_BOTLINE_AP;
-#ifdef FEAT_SCROLLBIND
        curwin->w_scbind_pos = 1;
-#endif
     }
 
     /*
@@ -2773,7 +2769,6 @@ halfpage(int flag, linenr_T Prenum)
     redraw_later(VALID);
 }
 
-#if defined(FEAT_CURSORBIND) || defined(PROTO)
     void
 do_check_cursorbind(void)
 {
@@ -2846,4 +2841,3 @@ do_check_cursorbind(void)
     curwin = old_curwin;
     curbuf = old_curbuf;
 }
-#endif /* FEAT_CURSORBIND */
index 5aa7fe0494cd86b06110e26e9a7b6140b3744e3f..89b2dc02a079a27a2c2214f579915b363411e399 100644 (file)
@@ -1275,21 +1275,17 @@ normal_end:
        mb_adjust_cursor();
 #endif
 
-#ifdef FEAT_SCROLLBIND
     if (curwin->w_p_scb && toplevel)
     {
        validate_cursor();      /* may need to update w_leftcol */
        do_check_scrollbind(TRUE);
     }
-#endif
 
-#ifdef FEAT_CURSORBIND
     if (curwin->w_p_crb && toplevel)
     {
        validate_cursor();      /* may need to update w_leftcol */
        do_check_cursorbind();
     }
-#endif
 
 #ifdef FEAT_TERMINAL
     /* don't go to Insert mode if a terminal has a running job */
@@ -3980,7 +3976,6 @@ display_showcmd(void)
 }
 #endif
 
-#ifdef FEAT_SCROLLBIND
 /*
  * When "check" is FALSE, prepare for commands that scroll the window.
  * 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;
     curbuf = old_curbuf;
 }
-#endif /* #ifdef FEAT_SCROLLBIND */
 
 /*
  * Command character that's ignored.
index 6fb24c536f461c36da5d60f92734a264a2b47da9..a2142aaf4eae04d0c7c86b9b1fcc1341ae6b9177 100644 (file)
 # define PV_RL         OPT_WIN(WV_RL)
 # define PV_RLC                OPT_WIN(WV_RLC)
 #endif
-#ifdef FEAT_SCROLLBIND
-# define PV_SCBIND     OPT_WIN(WV_SCBIND)
-#endif
+#define PV_SCBIND      OPT_WIN(WV_SCBIND)
 #define PV_SCROLL      OPT_WIN(WV_SCROLL)
 #ifdef FEAT_SPELL
 # define PV_SPELL      OPT_WIN(WV_SPELL)
 # define PV_WFH                OPT_WIN(WV_WFH)
 # define PV_WFW                OPT_WIN(WV_WFW)
 #define PV_WRAP                OPT_WIN(WV_WRAP)
-#ifdef FEAT_CURSORBIND
-# define PV_CRBIND     OPT_WIN(WV_CRBIND)
-#endif
+#define PV_CRBIND      OPT_WIN(WV_CRBIND)
 #ifdef FEAT_CONCEAL
 # define PV_COCU       OPT_WIN(WV_COCU)
 # define PV_COLE       OPT_WIN(WV_COLE)
@@ -976,11 +972,7 @@ static struct vimoption options[] =
 #endif
                            {(char_u *)0L, (char_u *)0L} SCRIPTID_INIT},
     {"cursorbind",  "crb",  P_BOOL|P_VI_DEF,
-#ifdef FEAT_CURSORBIND
                            (char_u *)VAR_WIN, PV_CRBIND,
-#else
-                           (char_u *)NULL, PV_NONE,
-#endif
                            {(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT},
     {"cursorcolumn", "cuc", P_BOOL|P_VI_DEF|P_RWIN,
 #ifdef FEAT_SYN_HL
@@ -2382,11 +2374,7 @@ static struct vimoption options[] =
                            (char_u *)VAR_WIN, PV_SCROLL,
                            {(char_u *)0L, (char_u *)0L} SCRIPTID_INIT},
     {"scrollbind",  "scb",  P_BOOL|P_VI_DEF,
-#ifdef FEAT_SCROLLBIND
                            (char_u *)VAR_WIN, PV_SCBIND,
-#else
-                           (char_u *)NULL, PV_NONE,
-#endif
                            {(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT},
     {"scrolljump",  "sj",   P_NUM|P_VI_DEF|P_VIM,
                            (char_u *)&p_sj, PV_NONE,
@@ -2395,13 +2383,8 @@ static struct vimoption options[] =
                            (char_u *)&p_so, PV_NONE,
                            {(char_u *)0L, (char_u *)0L} SCRIPTID_INIT},
     {"scrollopt",   "sbo",  P_STRING|P_VI_DEF|P_ONECOMMA|P_NODUP,
-#ifdef FEAT_SCROLLBIND
                            (char_u *)&p_sbo, PV_NONE,
                            {(char_u *)"ver,jump", (char_u *)0L}
-#else
-                           (char_u *)NULL, PV_NONE,
-                           {(char_u *)0L, (char_u *)0L}
-#endif
                            SCRIPTID_INIT},
     {"sections",    "sect", P_STRING|P_VI_DEF,
                            (char_u *)&p_sections, PV_NONE,
@@ -3230,9 +3213,7 @@ static char *(p_km_values[]) = {"startsel", "stopsel", NULL};
 #ifdef FEAT_BROWSE
 static char *(p_bsdir_values[]) = {"current", "last", "buffer", NULL};
 #endif
-#ifdef FEAT_SCROLLBIND
 static char *(p_scbopt_values[]) = {"ver", "hor", "jump", NULL};
-#endif
 static char *(p_debug_values[]) = {"msg", "throw", "beep", NULL};
 static char *(p_ead_values[]) = {"both", "ver", "hor", NULL};
 static char *(p_buftype_values[]) = {"nofile", "nowrite", "quickfix", "help", "terminal", "acwrite", NULL};
@@ -6240,13 +6221,11 @@ did_set_string_option(
 #endif
 
     /* 'scrollopt' */
-#ifdef FEAT_SCROLLBIND
     else if (varp == &p_sbo)
     {
        if (check_opt_strings(p_sbo, p_scbopt_values, TRUE) != OK)
            errmsg = e_invarg;
     }
-#endif
 
     /* 'ambiwidth' */
 #ifdef FEAT_MBYTE
@@ -8328,7 +8307,6 @@ set_bool_option(
     }
 #endif
 
-#ifdef FEAT_SCROLLBIND
     /* when 'scrollbind' is set: snapshot the current position to avoid a jump
      * at the end of normal_cmd() */
     else if ((int *)varp == &curwin->w_p_scb)
@@ -8339,7 +8317,6 @@ set_bool_option(
            curwin->w_scbind_pos = curwin->w_topline;
        }
     }
-#endif
 
 #if defined(FEAT_QUICKFIX)
     /* 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_BRIOPT: return (char_u *)&(curwin->w_p_briopt);
 #endif
-#ifdef FEAT_SCROLLBIND
        case PV_SCBIND: return (char_u *)&(curwin->w_p_scb);
-#endif
-#ifdef FEAT_CURSORBIND
        case PV_CRBIND: return (char_u *)&(curwin->w_p_crb);
-#endif
 #ifdef FEAT_CONCEAL
        case PV_COCU:   return (char_u *)&(curwin->w_p_cocu);
        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_briopt = vim_strsave(from->wo_briopt);
 #endif
-#ifdef FEAT_SCROLLBIND
     to->wo_scb = from->wo_scb;
     to->wo_scb_save = from->wo_scb_save;
-#endif
-#ifdef FEAT_CURSORBIND
     to->wo_crb = from->wo_crb;
     to->wo_crb_save = from->wo_crb_save;
-#endif
 #ifdef FEAT_SPELL
     to->wo_spell = from->wo_spell;
 #endif
index a338ba672d5cfda6a2e0be1f055c74283996928a..d408a2d0757daa52820ef7a921e657d70b6c35d4 100644 (file)
@@ -739,9 +739,7 @@ EXTERN char_u       *p_pp;          /* 'packpath' */
 EXTERN char_u  *p_rtp;         /* 'runtimepath' */
 EXTERN long    p_sj;           /* 'scrolljump' */
 EXTERN long    p_so;           /* 'scrolloff' */
-#ifdef FEAT_SCROLLBIND
 EXTERN char_u  *p_sbo;         /* 'scrollopt' */
-#endif
 EXTERN char_u  *p_sections;    /* 'sections' */
 EXTERN int     p_secure;       /* 'secure' */
 EXTERN char_u  *p_sel;         /* 'selection' */
@@ -1133,9 +1131,7 @@ enum
     , WV_TK
     , WV_TMS
 #endif
-#ifdef FEAT_CURSORBIND
     , WV_CRBIND
-#endif
 #ifdef FEAT_LINEBREAK
     , WV_BRI
     , WV_BRIOPT
@@ -1172,9 +1168,7 @@ enum
     , WV_RL
     , WV_RLC
 #endif
-#ifdef FEAT_SCROLLBIND
     , WV_SCBIND
-#endif
     , WV_SCROLL
 #ifdef FEAT_SPELL
     , WV_SPELL
index 56af7939d87e3892c855ed81f7ee3b1e798b2d61..6979dbc73438dfa2a3a986ef71f97bb434782e46 100644 (file)
@@ -244,14 +244,12 @@ typedef struct
     char_u     *wo_stl;
 #define w_p_stl w_onebuf_opt.wo_stl    /* 'statusline' */
 #endif
-#ifdef FEAT_SCROLLBIND
     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 */
-# 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*/
-# define w_p_scb_save w_onebuf_opt.wo_scb_save
-#endif
+#define w_p_scb_save w_onebuf_opt.wo_scb_save
     int                wo_wrap;
 #define w_p_wrap w_onebuf_opt.wo_wrap  /* 'wrap' */
 #ifdef FEAT_DIFF
@@ -264,12 +262,10 @@ typedef struct
     long       wo_cole;                /* 'conceallevel' */
 # define w_p_cole w_onebuf_opt.wo_cole
 #endif
-#ifdef FEAT_CURSORBIND
     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*/
-# define w_p_crb_save w_onebuf_opt.wo_crb_save
-#endif
+#define w_p_crb_save w_onebuf_opt.wo_crb_save
 #ifdef FEAT_SIGNS
     char_u     *wo_scl;
 # 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 */
 #define GLOBAL_WO(p)   ((char *)p + sizeof(winopt_T))
 
-#ifdef FEAT_SCROLLBIND
     long       w_scbind_pos;
-#endif
 
 #ifdef FEAT_EVAL
     dictitem_T w_winvar;       /* variable for "w:" Dictionary */
index 72b68123bc4ec4c7ed911b6791c61cf3b3097cd3..b063d9189ca820ee31e54f2a0883c6d8e0e46231 100644 (file)
@@ -3297,10 +3297,8 @@ set_shellsize(int width, int height, int mustset)
        }
        else
        {
-#ifdef FEAT_SCROLLBIND
            if (curwin->w_p_scb)
                do_check_scrollbind(TRUE);
-#endif
            if (State & CMDLINE)
            {
                update_screen(NOT_VALID);
index 01b812c1780d0953753a58d2e49a4bacb178bbc9..b00217dcd38038821aeae7b14c3cd870bc6b0368 100644 (file)
@@ -168,11 +168,7 @@ static char *(features[]) =
 #else
        "-cscope",
 #endif
-#ifdef FEAT_CURSORBIND
        "+cursorbind",
-#else
-       "-cursorbind",
-#endif
 #ifdef CURSOR_SHAPE
        "+cursorshape",
 #else
@@ -556,11 +552,7 @@ static char *(features[]) =
 #else
        "-ruby",
 #endif
-#ifdef FEAT_SCROLLBIND
        "+scrollbind",
-#else
-       "-scrollbind",
-#endif
 #ifdef FEAT_SIGNS
        "+signs",
 #else
@@ -774,6 +766,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1566,
 /**/
     1565,
 /**/
index 23c324b5b1cf796a7dd2e268704c0f3746acfe63..337f84dee12b807696783b1bb3cc7978d094694b 100644 (file)
@@ -4498,9 +4498,7 @@ win_alloc(win_T *after UNUSED, int hidden UNUSED)
 #endif
     new_wp->w_botline = 2;
     new_wp->w_cursor.lnum = 1;
-#ifdef FEAT_SCROLLBIND
     new_wp->w_scbind_pos = 1;
-#endif
 
     /* We won't calculate w_fraction until resizing the window */
     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
      * 'scrollbind' is set and this isn't the current window. */
-    if (height > 0
-#ifdef FEAT_SCROLLBIND
-           && (!wp->w_p_scb || wp == curwin)
-#endif
-       )
+    if (height > 0 && (!wp->w_p_scb || wp == curwin))
     {
        /*
         * Find a value for w_topline that shows the cursor at the same