lkundrak / rpms / vim

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