3ef2ca
To: vim_dev@googlegroups.com
3ef2ca
Subject: Patch 7.4.417
3ef2ca
Fcc: outbox
3ef2ca
From: Bram Moolenaar <Bram@moolenaar.net>
3ef2ca
Mime-Version: 1.0
3ef2ca
Content-Type: text/plain; charset=UTF-8
3ef2ca
Content-Transfer-Encoding: 8bit
3ef2ca
------------
3ef2ca
3ef2ca
Patch 7.4.417
3ef2ca
Problem:    After splitting a window and setting 'breakindent' the default
3ef2ca
	    minimum with is not respected.
3ef2ca
Solution:   Call briopt_check() when copying options to a new window.
3ef2ca
Files:	    src/option.c, src/proto/option.pro,
3ef2ca
	    src/testdir/test_breakindent.in
3ef2ca
3ef2ca
3ef2ca
*** ../vim-7.4.416/src/option.c	2014-08-13 21:58:24.820885492 +0200
3ef2ca
--- src/option.c	2014-08-24 21:30:49.468546394 +0200
3ef2ca
***************
3ef2ca
*** 3097,3102 ****
3ef2ca
--- 3097,3105 ----
3ef2ca
  static int opt_strings_flags __ARGS((char_u *val, char **values, unsigned *flagp, int list));
3ef2ca
  static int check_opt_strings __ARGS((char_u *val, char **values, int));
3ef2ca
  static int check_opt_wim __ARGS((void));
3ef2ca
+ #ifdef FEAT_LINEBREAK
3ef2ca
+ static int briopt_check __ARGS((win_T *wp));
3ef2ca
+ #endif
3ef2ca
  
3ef2ca
  /*
3ef2ca
   * Initialize the options, first part.
3ef2ca
***************
3ef2ca
*** 5289,5295 ****
3ef2ca
      (void)check_cedit();
3ef2ca
  #endif
3ef2ca
  #ifdef FEAT_LINEBREAK
3ef2ca
!     briopt_check();
3ef2ca
  #endif
3ef2ca
  }
3ef2ca
  
3ef2ca
--- 5292,5298 ----
3ef2ca
      (void)check_cedit();
3ef2ca
  #endif
3ef2ca
  #ifdef FEAT_LINEBREAK
3ef2ca
!     briopt_check(curwin);
3ef2ca
  #endif
3ef2ca
  }
3ef2ca
  
3ef2ca
***************
3ef2ca
*** 5748,5754 ****
3ef2ca
      /* 'breakindentopt' */
3ef2ca
      else if (varp == &curwin->w_p_briopt)
3ef2ca
      {
3ef2ca
! 	if (briopt_check() == FAIL)
3ef2ca
  	    errmsg = e_invarg;
3ef2ca
      }
3ef2ca
  #endif
3ef2ca
--- 5751,5757 ----
3ef2ca
      /* 'breakindentopt' */
3ef2ca
      else if (varp == &curwin->w_p_briopt)
3ef2ca
      {
3ef2ca
! 	if (briopt_check(curwin) == FAIL)
3ef2ca
  	    errmsg = e_invarg;
3ef2ca
      }
3ef2ca
  #endif
3ef2ca
***************
3ef2ca
*** 10232,10237 ****
3ef2ca
--- 10235,10243 ----
3ef2ca
      wp_to->w_farsi = wp_from->w_farsi;
3ef2ca
  #  endif
3ef2ca
  # endif
3ef2ca
+ #if defined(FEAT_LINEBREAK)
3ef2ca
+     briopt_check(wp_to);
3ef2ca
+ #endif
3ef2ca
  }
3ef2ca
  #endif
3ef2ca
  
3ef2ca
***************
3ef2ca
*** 12002,12016 ****
3ef2ca
   * This is called when 'breakindentopt' is changed and when a window is
3ef2ca
   * initialized.
3ef2ca
   */
3ef2ca
!     int
3ef2ca
! briopt_check()
3ef2ca
  {
3ef2ca
      char_u	*p;
3ef2ca
      int		bri_shift = 0;
3ef2ca
      long	bri_min = 20;
3ef2ca
      int		bri_sbr = FALSE;
3ef2ca
  
3ef2ca
!     p = curwin->w_p_briopt;
3ef2ca
      while (*p != NUL)
3ef2ca
      {
3ef2ca
  	if (STRNCMP(p, "shift:", 6) == 0
3ef2ca
--- 12008,12023 ----
3ef2ca
   * This is called when 'breakindentopt' is changed and when a window is
3ef2ca
   * initialized.
3ef2ca
   */
3ef2ca
!     static int
3ef2ca
! briopt_check(wp)
3ef2ca
!     win_T *wp;
3ef2ca
  {
3ef2ca
      char_u	*p;
3ef2ca
      int		bri_shift = 0;
3ef2ca
      long	bri_min = 20;
3ef2ca
      int		bri_sbr = FALSE;
3ef2ca
  
3ef2ca
!     p = wp->w_p_briopt;
3ef2ca
      while (*p != NUL)
3ef2ca
      {
3ef2ca
  	if (STRNCMP(p, "shift:", 6) == 0
3ef2ca
***************
3ef2ca
*** 12035,12043 ****
3ef2ca
  	    ++p;
3ef2ca
      }
3ef2ca
  
3ef2ca
!     curwin->w_p_brishift = bri_shift;
3ef2ca
!     curwin->w_p_brimin   = bri_min;
3ef2ca
!     curwin->w_p_brisbr   = bri_sbr;
3ef2ca
  
3ef2ca
      return OK;
3ef2ca
  }
3ef2ca
--- 12042,12050 ----
3ef2ca
  	    ++p;
3ef2ca
      }
3ef2ca
  
3ef2ca
!     wp->w_p_brishift = bri_shift;
3ef2ca
!     wp->w_p_brimin   = bri_min;
3ef2ca
!     wp->w_p_brisbr   = bri_sbr;
3ef2ca
  
3ef2ca
      return OK;
3ef2ca
  }
3ef2ca
*** ../vim-7.4.416/src/proto/option.pro	2014-06-25 14:44:04.458358774 +0200
3ef2ca
--- src/proto/option.pro	2014-08-24 21:30:53.588546244 +0200
3ef2ca
***************
3ef2ca
*** 62,66 ****
3ef2ca
  long get_sw_value __ARGS((buf_T *buf));
3ef2ca
  long get_sts_value __ARGS((void));
3ef2ca
  void find_mps_values __ARGS((int *initc, int *findc, int *backwards, int switchit));
3ef2ca
- int briopt_check __ARGS((void));
3ef2ca
  /* vim: set ft=c : */
3ef2ca
--- 62,65 ----
3ef2ca
*** ../vim-7.4.416/src/testdir/test_breakindent.in	2014-08-24 21:19:22.220571318 +0200
3ef2ca
--- src/testdir/test_breakindent.in	2014-08-24 21:37:40.616531483 +0200
3ef2ca
***************
3ef2ca
*** 27,32 ****
3ef2ca
--- 27,33 ----
3ef2ca
  :	$put =g:line1
3ef2ca
  :	wincmd p
3ef2ca
  :endfu
3ef2ca
+ :set briopt=min:0
3ef2ca
  :let g:test="Test 1: Simple breakindent"
3ef2ca
  :let line1=ScreenChar(8)
3ef2ca
  :call DoRecordScreen()
3ef2ca
*** ../vim-7.4.416/src/version.c	2014-08-24 21:19:22.224571318 +0200
3ef2ca
--- src/version.c	2014-08-24 21:29:09.156550032 +0200
3ef2ca
***************
3ef2ca
*** 743,744 ****
3ef2ca
--- 743,746 ----
3ef2ca
  {   /* Add new patch number below this line */
3ef2ca
+ /**/
3ef2ca
+     417,
3ef2ca
  /**/
3ef2ca
3ef2ca
3ef2ca
-- 
3ef2ca
hundred-and-one symptoms of being an internet addict:
3ef2ca
58. You turn on your computer and turn off your wife.
3ef2ca
3ef2ca
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
3ef2ca
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
3ef2ca
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
3ef2ca
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///