*** src/edit.c.HEAD.80235.c	2009-01-12 02:24:11.000000000 +1030
--- src/edit.c	2009-01-12 02:18:12.000000000 +1030
***************
*** 8733,8738 ****
--- 8733,8743 ----
  # endif
      }
  
+ #ifdef FEAT_SCROLLBIND
+     if (!vim_strchr(p_sbo, 'f'))
+ 	do_check_scrollbind(TRUE);
+ #endif
+ 
  # if defined(FEAT_GUI) && defined(FEAT_WINDOWS)
      curwin->w_redr_status = TRUE;
  
*** src/gui.c.HEAD.80235.c	2009-01-12 02:24:56.000000000 +1030
--- src/gui.c	2009-01-12 02:17:48.000000000 +1030
***************
*** 3770,3781 ****
      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
  #else
      char_u	bytes[sizeof(long_u)];
      int		byte_count;
--- 3770,3775 ----
***************
*** 3855,3860 ****
--- 3849,3866 ----
      }
  #endif
  
+ # ifdef FEAT_SCROLLBIND
+     /* Prime 'scrollbind' */
+     if (!vim_strchr(p_sbo, 'f')) {
+ 	wp = curwin;
+ 	if (sb->wp)
+ 	    curwin = sb->wp;
+ 	if (curwin->w_p_scb && !vim_strchr(p_sbo, 'f'))
+ 	    do_check_scrollbind(TRUE);
+ 	curwin = wp;
+     }
+ # endif
+ 
      if (sb->wp != NULL)		/* vertical scrollbar */
      {
  	sb_num = 0;
***************
*** 3946,3966 ****
      /*
       * 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
! 					   || curwin->w_topfill != old_topfill
! #  endif
! 			))))
!     {
! 	do_check_scrollbind(TRUE);
! 	/* need to update the window right here */
! 	for (wp = firstwin; wp != NULL; wp = wp->w_next)
! 	    if (wp->w_redr_type > 0)
! 		updateWindow(wp);
! 	setcursor();
!     }
  # endif
      out_flush();
      gui_update_cursor(FALSE, TRUE);
--- 3952,3973 ----
      /*
       * synchronize other windows, as necessary according to 'scrollbind'
       */
!     if (!vim_strchr(p_sbo, 'f')) {
! 	wp = curwin;
! 	if (sb->wp)
! 	    curwin = sb->wp;
! 	if (curwin->w_p_scb)
! 	    do_check_scrollbind(TRUE);
! 	curwin = wp;
!     } else {
! 	if (curwin->w_p_scb)
! 	    do_check_scrollbind(TRUE);
!     }
!     /* need to update the window right here */
!     for (wp = firstwin; wp != NULL; wp = wp->w_next)
! 	if (wp->w_redr_type > 0)
! 	    updateWindow(wp);
!     setcursor();
  # endif
      out_flush();
      gui_update_cursor(FALSE, TRUE);
*** src/normal.c.HEAD.80235.c	2009-01-12 02:25:07.000000000 +1030
--- src/normal.c	2009-01-12 02:14:34.000000000 +1030
***************
*** 4525,4530 ****
--- 4525,4535 ----
  	nv_scroll_line(cap);
      }
  
+ #ifdef FEAT_SCROLLBIND
+     if (!vim_strchr(p_sbo, 'f'))
+ 	do_check_scrollbind(TRUE);
+ #endif
+ 
  # if defined(FEAT_GUI) && defined(FEAT_WINDOWS)
      curwin->w_redr_status = TRUE;
  
*** runtime/doc/options.txt.START.83348.txt	2009-01-12 06:07:12.000000000 +1030
--- runtime/doc/options.txt	2009-01-12 06:05:10.000000000 +1030
***************
*** 5602,5608 ****
  	NOTE: This option is set to 0 when 'compatible' is set.
  
  						*'scrollopt'* *'sbo'*
! 'scrollopt' 'sbo'	string	(default "ver,jump")
  			global
  			{not available when compiled without the |+scrollbind|
  			feature}
--- 5602,5608 ----
  	NOTE: This option is set to 0 when 'compatible' is set.
  
  						*'scrollopt'* *'sbo'*
! 'scrollopt' 'sbo'	string	(default "ver,focusonly,jump")
  			global
  			{not available when compiled without the |+scrollbind|
  			feature}
***************
*** 5613,5618 ****
--- 5613,5620 ----
  	The following words are available:
  	    ver		Bind vertical scrolling for 'scrollbind' windows
  	    hor		Bind horizontal scrolling for 'scrollbind' windows
+ 	    focusonly	Only synchronize bound 'scrollbind' windows when
+ 			scrolling the focused window (containing the cursor)
  	    jump	Applies to the offset between two windows for vertical
  			scrolling.  This offset is the difference in the first
  			displayed line of the bound windows.  When moving
*** runtime/doc/scroll.txt.START.83348.txt	2009-01-12 06:08:28.000000000 +1030
--- runtime/doc/scroll.txt	2009-01-12 06:05:07.000000000 +1030
***************
*** 199,207 ****
  other 'scrollbind' windows are scrolled the same amount, if possible.  The
  behavior of 'scrollbind' can be modified by the 'scrollopt' option.
  
! When using the scrollbars, the binding only happens when scrolling the window
! with focus (where the cursor is).  You can use this to avoid scroll-binding
! for a moment without resetting options.
  
  When a window also has the 'diff' option set, the scroll-binding uses the
  differences between the two buffers to synchronize the position precisely.
--- 199,208 ----
  other 'scrollbind' windows are scrolled the same amount, if possible.  The
  behavior of 'scrollbind' can be modified by the 'scrollopt' option.
  
! When using the scrollbars and with the 'focusonly' flag set in 'scrollopt',
! the binding only happens when scrolling the window with focus (where the
! cursor is).  You can use this to avoid scroll-binding for a moment without
! resetting options.
  
  When a window also has the 'diff' option set, the scroll-binding uses the
  differences between the two buffers to synchronize the position precisely.
***************
*** 230,242 ****
  			the 'scrollbind' windows will also be at the top of
  			their buffers.
  
- 							*scrollbind-quickadj*
- The 'scrollbind' flag is meaningful when using keyboard commands to vertically
- scroll a window, and also meaningful when using the vertical scrollbar of the
- window which has the cursor focus.  However, when using the vertical scrollbar
- of a window which doesn't have the cursor focus, 'scrollbind' is ignored.
- This allows quick adjustment of the relative offset of 'scrollbind' windows.
- 
  ==============================================================================
  6. Scrolling with a mouse wheel				*scroll-mouse-wheel*
  
--- 231,236 ----
*** src/option.c.START.83348.c	2009-01-12 06:08:58.000000000 +1030
--- src/option.c	2009-01-12 06:01:28.000000000 +1030
***************
*** 2102,2108 ****
      {"scrollopt",   "sbo",  P_STRING|P_VI_DEF|P_COMMA|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}
--- 2102,2108 ----
      {"scrollopt",   "sbo",  P_STRING|P_VI_DEF|P_COMMA|P_NODUP,
  #ifdef FEAT_SCROLLBIND
  			    (char_u *)&p_sbo, PV_NONE,
! 			    {(char_u *)"ver,focusonly,jump", (char_u *)0L}
  #else
  			    (char_u *)NULL, PV_NONE,
  			    {(char_u *)0L, (char_u *)0L}
***************
*** 2882,2888 ****
  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};
  #ifdef FEAT_VERTSPLIT
--- 2882,2888 ----
  static char *(p_bsdir_values[]) = {"current", "last", "buffer", NULL};
  #endif
  #ifdef FEAT_SCROLLBIND
! static char *(p_scbopt_values[]) = {"ver", "hor", "focusonly", "jump", NULL};
  #endif
  static char *(p_debug_values[]) = {"msg", "throw", "beep", NULL};
  #ifdef FEAT_VERTSPLIT
