Karsten Hopp ee4e8f
To: vim_dev@googlegroups.com
Karsten Hopp ee4e8f
Subject: Patch 7.3.861
Karsten Hopp ee4e8f
Fcc: outbox
Karsten Hopp ee4e8f
From: Bram Moolenaar <Bram@moolenaar.net>
Karsten Hopp ee4e8f
Mime-Version: 1.0
Karsten Hopp ee4e8f
Content-Type: text/plain; charset=UTF-8
Karsten Hopp ee4e8f
Content-Transfer-Encoding: 8bit
Karsten Hopp ee4e8f
------------
Karsten Hopp ee4e8f
Karsten Hopp ee4e8f
Patch 7.3.861
Karsten Hopp ee4e8f
Problem:    ":setlocal number" clears global value of 'relativenumber'.
Karsten Hopp ee4e8f
Solution:   Do it properly. (Markus Heidelberg)
Karsten Hopp ee4e8f
Files:	    src/testdir/test89.in, src/testdir/test89.ok, src/option.c
Karsten Hopp ee4e8f
Karsten Hopp ee4e8f
Karsten Hopp ee4e8f
*** ../vim-7.3.860/src/testdir/test89.in	2013-02-14 20:10:28.000000000 +0100
Karsten Hopp ee4e8f
--- src/testdir/test89.in	2013-03-13 20:27:10.000000000 +0100
Karsten Hopp ee4e8f
***************
Karsten Hopp ee4e8f
*** 10,15 ****
Karsten Hopp ee4e8f
--- 10,52 ----
Karsten Hopp ee4e8f
  :$put ='results:'
Karsten Hopp ee4e8f
  :$put a
Karsten Hopp ee4e8f
  :$put b
Karsten Hopp ee4e8f
+ :"
Karsten Hopp ee4e8f
+ :set nonu nornu
Karsten Hopp ee4e8f
+ :setglobal nu
Karsten Hopp ee4e8f
+ :setlocal rnu
Karsten Hopp ee4e8f
+ :redir @c | setglobal nu? | redir END
Karsten Hopp ee4e8f
+ :set nonu nornu
Karsten Hopp ee4e8f
+ :setglobal rnu
Karsten Hopp ee4e8f
+ :setlocal nu
Karsten Hopp ee4e8f
+ :redir @d | setglobal rnu? | redir END
Karsten Hopp ee4e8f
+ :$put =':setlocal must NOT reset the other global value'
Karsten Hopp ee4e8f
+ :$put c
Karsten Hopp ee4e8f
+ :$put d
Karsten Hopp ee4e8f
+ :"
Karsten Hopp ee4e8f
+ :set nonu nornu
Karsten Hopp ee4e8f
+ :setglobal nu
Karsten Hopp ee4e8f
+ :setglobal rnu
Karsten Hopp ee4e8f
+ :redir @e | setglobal nu? | redir END
Karsten Hopp ee4e8f
+ :set nonu nornu
Karsten Hopp ee4e8f
+ :setglobal rnu
Karsten Hopp ee4e8f
+ :setglobal nu
Karsten Hopp ee4e8f
+ :redir @f | setglobal rnu? | redir END
Karsten Hopp ee4e8f
+ :$put =':setglobal MUST reset the other global value'
Karsten Hopp ee4e8f
+ :$put e
Karsten Hopp ee4e8f
+ :$put f
Karsten Hopp ee4e8f
+ :"
Karsten Hopp ee4e8f
+ :set nonu nornu
Karsten Hopp ee4e8f
+ :set nu
Karsten Hopp ee4e8f
+ :set rnu
Karsten Hopp ee4e8f
+ :redir @g | setglobal nu? | redir END
Karsten Hopp ee4e8f
+ :set nonu nornu
Karsten Hopp ee4e8f
+ :set rnu
Karsten Hopp ee4e8f
+ :set nu
Karsten Hopp ee4e8f
+ :redir @h | setglobal rnu? | redir END
Karsten Hopp ee4e8f
+ :$put =':set MUST reset the other global value'
Karsten Hopp ee4e8f
+ :$put g
Karsten Hopp ee4e8f
+ :$put h
Karsten Hopp ee4e8f
+ :"
Karsten Hopp ee4e8f
  :/^results/,$w! test.out
Karsten Hopp ee4e8f
  :q!
Karsten Hopp ee4e8f
  ENDTEST
Karsten Hopp ee4e8f
*** ../vim-7.3.860/src/testdir/test89.ok	2013-02-13 15:44:22.000000000 +0100
Karsten Hopp ee4e8f
--- src/testdir/test89.ok	2013-03-13 20:27:10.000000000 +0100
Karsten Hopp ee4e8f
***************
Karsten Hopp ee4e8f
*** 5,7 ****
Karsten Hopp ee4e8f
--- 5,22 ----
Karsten Hopp ee4e8f
  
Karsten Hopp ee4e8f
  nonumber
Karsten Hopp ee4e8f
    relativenumber
Karsten Hopp ee4e8f
+ :setlocal must NOT reset the other global value
Karsten Hopp ee4e8f
+ 
Karsten Hopp ee4e8f
+   number
Karsten Hopp ee4e8f
+ 
Karsten Hopp ee4e8f
+   relativenumber
Karsten Hopp ee4e8f
+ :setglobal MUST reset the other global value
Karsten Hopp ee4e8f
+ 
Karsten Hopp ee4e8f
+ nonumber
Karsten Hopp ee4e8f
+ 
Karsten Hopp ee4e8f
+ norelativenumber
Karsten Hopp ee4e8f
+ :set MUST reset the other global value
Karsten Hopp ee4e8f
+ 
Karsten Hopp ee4e8f
+ nonumber
Karsten Hopp ee4e8f
+ 
Karsten Hopp ee4e8f
+ norelativenumber
Karsten Hopp ee4e8f
*** ../vim-7.3.860/src/option.c	2013-03-13 19:29:24.000000000 +0100
Karsten Hopp ee4e8f
--- src/option.c	2013-03-13 20:35:20.000000000 +0100
Karsten Hopp ee4e8f
***************
Karsten Hopp ee4e8f
*** 7631,7652 ****
Karsten Hopp ee4e8f
      }
Karsten Hopp ee4e8f
  #endif
Karsten Hopp ee4e8f
  
Karsten Hopp ee4e8f
!     /* 'number', 'relativenumber' */
Karsten Hopp ee4e8f
!     else if ((int *)varp == &curwin->w_p_nu
Karsten Hopp ee4e8f
! 	  || (int *)varp == &curwin->w_p_rnu)
Karsten Hopp ee4e8f
      {
Karsten Hopp ee4e8f
! 	/* If 'number' is set, reset 'relativenumber'. */
Karsten Hopp ee4e8f
! 	/* If 'relativenumber' is set, reset 'number'. */
Karsten Hopp ee4e8f
! 	if ((int *)varp == &curwin->w_p_nu && curwin->w_p_nu)
Karsten Hopp ee4e8f
! 	{
Karsten Hopp ee4e8f
! 	    curwin->w_p_rnu = FALSE;
Karsten Hopp ee4e8f
  	    curwin->w_allbuf_opt.wo_rnu = FALSE;
Karsten Hopp ee4e8f
! 	}
Karsten Hopp ee4e8f
! 	if ((int *)varp == &curwin->w_p_rnu && curwin->w_p_rnu)
Karsten Hopp ee4e8f
! 	{
Karsten Hopp ee4e8f
! 	    curwin->w_p_nu = FALSE;
Karsten Hopp ee4e8f
  	    curwin->w_allbuf_opt.wo_nu = FALSE;
Karsten Hopp ee4e8f
! 	}
Karsten Hopp ee4e8f
      }
Karsten Hopp ee4e8f
  
Karsten Hopp ee4e8f
      else if ((int *)varp == &curbuf->b_p_ro)
Karsten Hopp ee4e8f
--- 7631,7663 ----
Karsten Hopp ee4e8f
      }
Karsten Hopp ee4e8f
  #endif
Karsten Hopp ee4e8f
  
Karsten Hopp ee4e8f
!     /* If 'number' is set, reset 'relativenumber'. */
Karsten Hopp ee4e8f
!     /* If 'relativenumber' is set, reset 'number'. */
Karsten Hopp ee4e8f
!     else if ((int *)varp == &curwin->w_p_nu && curwin->w_p_nu)
Karsten Hopp ee4e8f
      {
Karsten Hopp ee4e8f
! 	curwin->w_p_rnu = FALSE;
Karsten Hopp ee4e8f
! 
Karsten Hopp ee4e8f
! 	/* Only reset the global value if the own value is set globally. */
Karsten Hopp ee4e8f
! 	if (((opt_flags & (OPT_LOCAL | OPT_GLOBAL)) == 0))
Karsten Hopp ee4e8f
  	    curwin->w_allbuf_opt.wo_rnu = FALSE;
Karsten Hopp ee4e8f
!     }
Karsten Hopp ee4e8f
!     else if ((int *)varp == &curwin->w_p_rnu && curwin->w_p_rnu)
Karsten Hopp ee4e8f
!     {
Karsten Hopp ee4e8f
! 	curwin->w_p_nu = FALSE;
Karsten Hopp ee4e8f
! 
Karsten Hopp ee4e8f
! 	/* Only reset the global value if the own value is set globally. */
Karsten Hopp ee4e8f
! 	if (((opt_flags & (OPT_LOCAL | OPT_GLOBAL)) == 0))
Karsten Hopp ee4e8f
  	    curwin->w_allbuf_opt.wo_nu = FALSE;
Karsten Hopp ee4e8f
!     }
Karsten Hopp ee4e8f
!     else if ((int *)varp == &curwin->w_allbuf_opt.wo_nu
Karsten Hopp ee4e8f
! 						&& curwin->w_allbuf_opt.wo_nu)
Karsten Hopp ee4e8f
!     {
Karsten Hopp ee4e8f
!         curwin->w_allbuf_opt.wo_rnu = FALSE;
Karsten Hopp ee4e8f
!     }
Karsten Hopp ee4e8f
!     else if ((int *)varp == &curwin->w_allbuf_opt.wo_rnu
Karsten Hopp ee4e8f
! 					       && curwin->w_allbuf_opt.wo_rnu)
Karsten Hopp ee4e8f
!     {
Karsten Hopp ee4e8f
!         curwin->w_allbuf_opt.wo_nu = FALSE;
Karsten Hopp ee4e8f
      }
Karsten Hopp ee4e8f
  
Karsten Hopp ee4e8f
      else if ((int *)varp == &curbuf->b_p_ro)
Karsten Hopp ee4e8f
*** ../vim-7.3.860/src/version.c	2013-03-13 20:23:17.000000000 +0100
Karsten Hopp ee4e8f
--- src/version.c	2013-03-13 20:42:09.000000000 +0100
Karsten Hopp ee4e8f
***************
Karsten Hopp ee4e8f
*** 730,731 ****
Karsten Hopp ee4e8f
--- 730,733 ----
Karsten Hopp ee4e8f
  {   /* Add new patch number below this line */
Karsten Hopp ee4e8f
+ /**/
Karsten Hopp ee4e8f
+     861,
Karsten Hopp ee4e8f
  /**/
Karsten Hopp ee4e8f
Karsten Hopp ee4e8f
-- 
Karsten Hopp ee4e8f
hundred-and-one symptoms of being an internet addict:
Karsten Hopp ee4e8f
43. You tell the kids they can't use the computer because "Daddy's got work to
Karsten Hopp ee4e8f
    do" and you don't even have a job.
Karsten Hopp ee4e8f
Karsten Hopp ee4e8f
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
Karsten Hopp ee4e8f
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
Karsten Hopp ee4e8f
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
Karsten Hopp ee4e8f
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///