0
0
mirror of https://github.com/vim/vim.git synced 2025-09-25 03:54:15 -04:00

updated for version 7.4.686

Problem:    "zr" and "zm" do not take a count.
Solution:   Implement the count, restrict the fold level to the maximum
            nesting depth.  (Marcin Szamotulski)
This commit is contained in:
Bram Moolenaar
2015-03-31 17:46:22 +02:00
parent 0e462411ca
commit 7d2757a472
3 changed files with 16 additions and 4 deletions

View 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 */