Skip to content
Browse files

updated for version 7.3.008

Problem:    'cursorbind' is kept in places where 'scrollbind' is reset.
Solution:   Reset 'cursorbind'.
  • Loading branch information...
1 parent e4b1724 commit 3faee0eea86e1cd7a5bb6e96efcc63d8ba0cbcab @brammool brammool committed Sep 21, 2010
Showing with 45 additions and 52 deletions.
  1. +6 −5 src/buffer.c
  2. +5 −6 src/diff.c
  3. +3 −6 src/ex_cmds.c
  4. +1 −3 src/ex_cmds2.c
  5. +4 −4 src/ex_docmd.c
  6. +1 −3 src/ex_getln.c
  7. +1 −3 src/if_cscope.c
  8. +14 −0 src/macros.h
  9. +2 −6 src/quickfix.c
  10. +1 −3 src/search.c
  11. +1 −3 src/tag.c
  12. +2 −0 src/version.c
  13. +4 −10 src/window.c
View
11 src/buffer.c
@@ -1288,9 +1288,12 @@ do_buffer(action, start, dir, count, forceit)
/* Go to the other buffer. */
set_curbuf(buf, action);
-#if defined(FEAT_LISTCMDS) && defined(FEAT_SCROLLBIND)
+#if defined(FEAT_LISTCMDS) \
+ && (defined(FEAT_SCROLLBIND) || defined(FEAT_CURSORBIND))
if (action == DOBUF_SPLIT)
- curwin->w_p_scb = FALSE; /* reset 'scrollbind' */
+ {
+ RESET_BINDING(curwin); /* reset 'scrollbind' and 'cursorbind' */
+ }
#endif
#if defined(FEAT_AUTOCMD) && defined(FEAT_EVAL)
@@ -1917,9 +1920,7 @@ buflist_getfile(n, lnum, options, forceit)
tabpage_new();
else if (win_split(0, 0) == FAIL) /* Open in a new window */
return FAIL;
-# ifdef FEAT_SCROLLBIND
- curwin->w_p_scb = FALSE;
-# endif
+ RESET_BINDING(curwin);
}
}
#endif
View
11 src/diff.c
@@ -1127,11 +1127,13 @@ diff_win_options(wp, addbuf)
# endif
wp->w_p_diff = TRUE;
+ /* Use 'scrollbind' and 'cursorbind' when available */
+#ifdef FEAT_SCROLLBIND
+ wp->w_p_scb = TRUE;
+#endif
#ifdef FEAT_CURSORBIND
- /* Use cursorbind if it's available */
wp->w_p_crb = TRUE;
#endif
- wp->w_p_scb = TRUE;
wp->w_p_wrap = FALSE;
# ifdef FEAT_FOLDING
curwin = wp;
@@ -1177,10 +1179,7 @@ ex_diffoff(eap)
{
/* Set 'diff', 'scrollbind' off and 'wrap' on. */
wp->w_p_diff = FALSE;
-#ifdef FEAT_CURSORBIND
- wp->w_p_crb = FALSE;
-#endif
- wp->w_p_scb = FALSE;
+ RESET_BINDING(wp);
wp->w_p_wrap = TRUE;
#ifdef FEAT_FOLDING
curwin = wp;
View
9 src/ex_cmds.c
@@ -3498,9 +3498,7 @@ do_ecmd(fnum, ffname, sfname, eap, newlnum, flags, oldwin)
curbuf->b_p_bin = FALSE; /* reset 'bin' before reading file */
curwin->w_p_nu = 0; /* no line numbers */
curwin->w_p_rnu = 0; /* no relative line numbers */
-#ifdef FEAT_SCROLLBIND
- curwin->w_p_scb = FALSE; /* no scroll binding */
-#endif
+ RESET_BINDING(curwin); /* no scroll or cursor binding */
#ifdef FEAT_ARABIC
curwin->w_p_arab = FALSE; /* no arabic mode */
#endif
@@ -5471,9 +5469,8 @@ prepare_tagpreview(undo_sync)
return FALSE;
curwin->w_p_pvw = TRUE;
curwin->w_p_wfh = TRUE;
-# ifdef FEAT_SCROLLBIND
- curwin->w_p_scb = FALSE; /* don't take over 'scrollbind' */
-# endif
+ RESET_BINDING(curwin); /* don't take over 'scrollbind'
+ and 'cursorbind' */
# ifdef FEAT_DIFF
curwin->w_p_diff = FALSE; /* no 'diff' */
# endif
View
4 src/ex_cmds2.c
@@ -2165,9 +2165,7 @@ do_argfile(eap, argn)
{
if (win_split(0, 0) == FAIL)
return;
-# ifdef FEAT_SCROLLBIND
- curwin->w_p_scb = FALSE;
-# endif
+ RESET_BINDING(curwin);
}
else
#endif
View
8 src/ex_docmd.c
@@ -6898,9 +6898,7 @@ handle_drop(filec, filev, split)
# ifdef FEAT_WINDOWS
if (win_split(0, 0) == FAIL)
return;
-# ifdef FEAT_SCROLLBIND
- curwin->w_p_scb = FALSE;
-# endif
+ RESET_BINDING(curwin);
/* When splitting the window, create a new alist. Otherwise the
* existing one is overwritten. */
@@ -7300,7 +7298,9 @@ ex_splitview(eap)
|| cmdmod.browse
# endif
)
- curwin->w_p_scb = FALSE;
+ {
+ RESET_BINDING(curwin);
+ }
else
do_check_scrollbind(FALSE);
# endif
View
4 src/ex_getln.c
@@ -6147,9 +6147,7 @@ ex_window()
curwin->w_p_rl = cmdmsg_rl;
cmdmsg_rl = FALSE;
# endif
-# ifdef FEAT_SCROLLBIND
- curwin->w_p_scb = FALSE;
-# endif
+ RESET_BINDING(curwin);
# ifdef FEAT_AUTOCMD
/* Do execute autocommands for setting the filetype (load syntax). */
View
4 src/if_cscope.c
@@ -1274,9 +1274,7 @@ cs_find_common(opt, pat, forceit, verbose, use_ll, cmdline)
{
win_split(postponed_split > 0 ? postponed_split : 0,
postponed_split_flags);
-# ifdef FEAT_SCROLLBIND
- curwin->w_p_scb = FALSE;
-# endif
+ RESET_BINDING(curwin);
postponed_split = 0;
}
# endif
View
14 src/macros.h
@@ -285,3 +285,17 @@
#else
# 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
View
8 src/quickfix.c
@@ -1656,9 +1656,7 @@ qf_jump(qi, dir, errornr, forceit)
opened_window = TRUE; /* close it when fail */
p_swb = empty_option; /* don't split again */
swb_flags = 0;
-# ifdef FEAT_SCROLLBIND
- curwin->w_p_scb = FALSE;
-# endif
+ RESET_BINDING(curwin);
if (ll_ref != NULL)
{
/* The new window should use the location list from the
@@ -2334,9 +2332,7 @@ ex_copen(eap)
win_goto(lastwin);
if (win_split(height, WSP_BELOW | WSP_NEWLOC) == FAIL)
return; /* not enough room for window */
-#ifdef FEAT_SCROLLBIND
- curwin->w_p_scb = FALSE;
-#endif
+ RESET_BINDING(curwin);
if (eap->cmdidx == CMD_lopen || eap->cmdidx == CMD_lwindow)
{
View
4 src/search.c
@@ -5075,9 +5075,7 @@ find_pattern_in_path(ptr, dir, len, whole, skip_comments,
if (win_split(0, 0) == FAIL)
#endif
break;
-#ifdef FEAT_SCROLLBIND
- curwin->w_p_scb = FALSE;
-#endif
+ RESET_BINDING(curwin);
}
if (depth == -1)
{
View
4 src/tag.c
@@ -3143,9 +3143,7 @@ jumpto_tag(lbuf, forceit, keep_help)
{
win_split(postponed_split > 0 ? postponed_split : 0,
postponed_split_flags);
-# ifdef FEAT_SCROLLBIND
- curwin->w_p_scb = FALSE;
-# endif
+ RESET_BINDING(curwin);
}
#endif
View
2 src/version.c
@@ -715,6 +715,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 8,
+/**/
7,
/**/
6,
View
14 src/window.c
@@ -525,9 +525,7 @@ do_window(nchar, Prenum, xchar)
setpcmark();
if (win_split(0, 0) == OK)
{
-# ifdef FEAT_SCROLLBIND
- curwin->w_p_scb = FALSE;
-# endif
+ RESET_BINDING(curwin);
(void)do_ecmd(0, ptr, NULL, NULL, ECMD_LASTL,
ECMD_HIDE, NULL);
if (nchar == 'F' && lnum >= 0)
@@ -3277,9 +3275,7 @@ win_alloc_aucmd_win()
if (aucmd_win != NULL)
{
win_init_some(aucmd_win, curwin);
-# ifdef FEAT_SCROLLBIND
- aucmd_win->w_p_scb = FALSE;
-# endif
+ RESET_BINDING(aucmd_win);
new_frame(aucmd_win);
}
}
@@ -3320,10 +3316,8 @@ win_alloc_firstwin(oldwin)
/* First window in new tab page, initialize it from "oldwin". */
win_init(curwin, oldwin, 0);
-# ifdef FEAT_SCROLLBIND
- /* We don't want scroll-binding in the first window. */
- curwin->w_p_scb = FALSE;
-# endif
+ /* We don't want cursor- and scroll-binding in the first window. */
+ RESET_BINDING(curwin);
}
#endif

0 comments on commit 3faee0e

Please sign in to comment.
Something went wrong with that request. Please try again.