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