Karsten Hopp 7e5428
To: vim_dev@googlegroups.com
Karsten Hopp 7e5428
Subject: Patch 7.4.686
Karsten Hopp 7e5428
Fcc: outbox
Karsten Hopp 7e5428
From: Bram Moolenaar <Bram@moolenaar.net>
Karsten Hopp 7e5428
Mime-Version: 1.0
Karsten Hopp 7e5428
Content-Type: text/plain; charset=UTF-8
Karsten Hopp 7e5428
Content-Transfer-Encoding: 8bit
Karsten Hopp 7e5428
------------
Karsten Hopp 7e5428
Karsten Hopp 7e5428
Patch 7.4.686
Karsten Hopp 7e5428
Problem:    "zr" and "zm" do not take a count.
Karsten Hopp 7e5428
Solution:   Implement the count, restrict the fold level to the maximum
Karsten Hopp 7e5428
	    nesting depth.  (Marcin Szamotulski)
Karsten Hopp 7e5428
Files:	    runtime/doc/fold.txt, src/normal.c
Karsten Hopp 7e5428
Karsten Hopp 7e5428
Karsten Hopp 7e5428
*** ../vim-7.4.685/runtime/doc/fold.txt	2013-08-10 13:24:53.000000000 +0200
Karsten Hopp 7e5428
--- runtime/doc/fold.txt	2015-03-31 17:40:11.592129921 +0200
Karsten Hopp 7e5428
***************
Karsten Hopp 7e5428
*** 364,370 ****
Karsten Hopp 7e5428
  		Also forces recomputing folds, like |zx|.
Karsten Hopp 7e5428
  
Karsten Hopp 7e5428
  							*zm*
Karsten Hopp 7e5428
! zm		Fold more: Subtract one from 'foldlevel'.  If 'foldlevel' was
Karsten Hopp 7e5428
  		already zero nothing happens.
Karsten Hopp 7e5428
  		'foldenable' will be set.
Karsten Hopp 7e5428
  
Karsten Hopp 7e5428
--- 365,371 ----
Karsten Hopp 7e5428
  		Also forces recomputing folds, like |zx|.
Karsten Hopp 7e5428
  
Karsten Hopp 7e5428
  							*zm*
Karsten Hopp 7e5428
! zm		Fold more: Subtract |v:count1| from 'foldlevel'.  If 'foldlevel' was
Karsten Hopp 7e5428
  		already zero nothing happens.
Karsten Hopp 7e5428
  		'foldenable' will be set.
Karsten Hopp 7e5428
  
Karsten Hopp 7e5428
***************
Karsten Hopp 7e5428
*** 373,379 ****
Karsten Hopp 7e5428
  		'foldenable' will be set.
Karsten Hopp 7e5428
  
Karsten Hopp 7e5428
  							*zr*
Karsten Hopp 7e5428
! zr		Reduce folding: Add one to 'foldlevel'.
Karsten Hopp 7e5428
  
Karsten Hopp 7e5428
  							*zR*
Karsten Hopp 7e5428
  zR		Open all folds.  This sets 'foldlevel' to highest fold level.
Karsten Hopp 7e5428
--- 374,380 ----
Karsten Hopp 7e5428
  		'foldenable' will be set.
Karsten Hopp 7e5428
  
Karsten Hopp 7e5428
  							*zr*
Karsten Hopp 7e5428
! zr		Reduce folding: Add |v:count1| to 'foldlevel'.
Karsten Hopp 7e5428
  
Karsten Hopp 7e5428
  							*zR*
Karsten Hopp 7e5428
  zR		Open all folds.  This sets 'foldlevel' to highest fold level.
Karsten Hopp 7e5428
*** ../vim-7.4.685/src/normal.c	2015-03-05 19:57:45.322721298 +0100
Karsten Hopp 7e5428
--- src/normal.c	2015-03-31 17:44:50.401075155 +0200
Karsten Hopp 7e5428
***************
Karsten Hopp 7e5428
*** 5098,5104 ****
Karsten Hopp 7e5428
  
Karsten Hopp 7e5428
  		/* "zm": fold more */
Karsten Hopp 7e5428
      case 'm':	if (curwin->w_p_fdl > 0)
Karsten Hopp 7e5428
! 		    --curwin->w_p_fdl;
Karsten Hopp 7e5428
  		old_fdl = -1;		/* force an update */
Karsten Hopp 7e5428
  		curwin->w_p_fen = TRUE;
Karsten Hopp 7e5428
  		break;
Karsten Hopp 7e5428
--- 5098,5108 ----
Karsten Hopp 7e5428
  
Karsten Hopp 7e5428
  		/* "zm": fold more */
Karsten Hopp 7e5428
      case 'm':	if (curwin->w_p_fdl > 0)
Karsten Hopp 7e5428
! 		{
Karsten Hopp 7e5428
! 		    curwin->w_p_fdl -= cap->count1;
Karsten Hopp 7e5428
! 		    if (curwin->w_p_fdl < 0)
Karsten Hopp 7e5428
! 			curwin->w_p_fdl = 0;
Karsten Hopp 7e5428
! 		}
Karsten Hopp 7e5428
  		old_fdl = -1;		/* force an update */
Karsten Hopp 7e5428
  		curwin->w_p_fen = TRUE;
Karsten Hopp 7e5428
  		break;
Karsten Hopp 7e5428
***************
Karsten Hopp 7e5428
*** 5110,5116 ****
Karsten Hopp 7e5428
  		break;
Karsten Hopp 7e5428
  
Karsten Hopp 7e5428
  		/* "zr": reduce folding */
Karsten Hopp 7e5428
!     case 'r':	++curwin->w_p_fdl;
Karsten Hopp 7e5428
  		break;
Karsten Hopp 7e5428
  
Karsten Hopp 7e5428
  		/* "zR": open all folds */
Karsten Hopp 7e5428
--- 5114,5126 ----
Karsten Hopp 7e5428
  		break;
Karsten Hopp 7e5428
  
Karsten Hopp 7e5428
  		/* "zr": reduce folding */
Karsten Hopp 7e5428
!     case 'r':	curwin->w_p_fdl += cap->count1;
Karsten Hopp 7e5428
! 		{
Karsten Hopp 7e5428
! 		    int d = getDeepestNesting();
Karsten Hopp 7e5428
! 
Karsten Hopp 7e5428
! 		    if (curwin->w_p_fdl >= d)
Karsten Hopp 7e5428
! 			curwin->w_p_fdl = d;
Karsten Hopp 7e5428
! 		}
Karsten Hopp 7e5428
  		break;
Karsten Hopp 7e5428
  
Karsten Hopp 7e5428
  		/* "zR": open all folds */
Karsten Hopp 7e5428
*** ../vim-7.4.685/src/version.c	2015-03-31 14:17:22.008608243 +0200
Karsten Hopp 7e5428
--- src/version.c	2015-03-31 17:41:32.839240108 +0200
Karsten Hopp 7e5428
***************
Karsten Hopp 7e5428
*** 743,744 ****
Karsten Hopp 7e5428
--- 743,746 ----
Karsten Hopp 7e5428
  {   /* Add new patch number below this line */
Karsten Hopp 7e5428
+ /**/
Karsten Hopp 7e5428
+     686,
Karsten Hopp 7e5428
  /**/
Karsten Hopp 7e5428
Karsten Hopp 7e5428
-- 
Karsten Hopp 7e5428
Kisses may last for as much as, but no more than, five minutes.
Karsten Hopp 7e5428
		[real standing law in Iowa, United States of America]
Karsten Hopp 7e5428
Karsten Hopp 7e5428
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
Karsten Hopp 7e5428
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
Karsten Hopp 7e5428
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
Karsten Hopp 7e5428
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///