jkunstle / rpms / vim

Forked from rpms/vim 3 years ago
Clone

Blame SOURCES/7.4.417

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