]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
updated for version 7.4.686 v7.4.686
authorBram Moolenaar <Bram@vim.org>
Tue, 31 Mar 2015 15:46:22 +0000 (17:46 +0200)
committerBram Moolenaar <Bram@vim.org>
Tue, 31 Mar 2015 15:46:22 +0000 (17:46 +0200)
Problem:    "zr" and "zm" do not take a count.
Solution:   Implement the count, restrict the fold level to the maximum
            nesting depth.  (Marcin Szamotulski)

runtime/doc/fold.txt
src/normal.c
src/version.c

index 6ae2ff86822ee8e929995653c2fb9713a95a7256..20017d3538d324300f91a3cb05f983b9bb23bee1 100644 (file)
@@ -365,7 +365,7 @@ zX          Undo manually opened and closed folds: re-apply 'foldlevel'.
                Also forces recomputing folds, like |zx|.
 
                                                        *zm*
-zm             Fold more: Subtract one from 'foldlevel'.  If 'foldlevel' was
+zm             Fold more: Subtract |v:count1| from 'foldlevel'.  If 'foldlevel' was
                already zero nothing happens.
                'foldenable' will be set.
 
@@ -374,7 +374,7 @@ zM          Close all folds: set 'foldlevel' to 0.
                'foldenable' will be set.
 
                                                        *zr*
-zr             Reduce folding: Add one to 'foldlevel'.
+zr             Reduce folding: Add |v:count1| to 'foldlevel'.
 
                                                        *zR*
 zR             Open all folds.  This sets 'foldlevel' to highest fold level.
index d173c737b9b533dbc34e7262dcca50b9a2bc29e7..c29ab1a48c758df3ef542ee928afa401d0f4a65f 100644 (file)
@@ -5098,7 +5098,11 @@ dozet:
 
                /* "zm": fold more */
     case 'm':  if (curwin->w_p_fdl > 0)
-                   --curwin->w_p_fdl;
+               {
+                   curwin->w_p_fdl -= cap->count1;
+                   if (curwin->w_p_fdl < 0)
+                       curwin->w_p_fdl = 0;
+               }
                old_fdl = -1;           /* force an update */
                curwin->w_p_fen = TRUE;
                break;
@@ -5110,7 +5114,13 @@ dozet:
                break;
 
                /* "zr": reduce folding */
-    case 'r':  ++curwin->w_p_fdl;
+    case 'r':  curwin->w_p_fdl += cap->count1;
+               {
+                   int d = getDeepestNesting();
+
+                   if (curwin->w_p_fdl >= d)
+                       curwin->w_p_fdl = d;
+               }
                break;
 
                /* "zR": open all folds */
index 6156c3731913883649146d16cf8b2655aef65f96..89e70848a35c241ed2d1571799f057dd8e55a070 100644 (file)
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    686,
 /**/
     685,
 /**/