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:
@@ -365,7 +365,7 @@ zX Undo manually opened and closed folds: re-apply 'foldlevel'.
|
|||||||
Also forces recomputing folds, like |zx|.
|
Also forces recomputing folds, like |zx|.
|
||||||
|
|
||||||
*zm*
|
*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.
|
already zero nothing happens.
|
||||||
'foldenable' will be set.
|
'foldenable' will be set.
|
||||||
|
|
||||||
@@ -374,7 +374,7 @@ zM Close all folds: set 'foldlevel' to 0.
|
|||||||
'foldenable' will be set.
|
'foldenable' will be set.
|
||||||
|
|
||||||
*zr*
|
*zr*
|
||||||
zr Reduce folding: Add one to 'foldlevel'.
|
zr Reduce folding: Add |v:count1| to 'foldlevel'.
|
||||||
|
|
||||||
*zR*
|
*zR*
|
||||||
zR Open all folds. This sets 'foldlevel' to highest fold level.
|
zR Open all folds. This sets 'foldlevel' to highest fold level.
|
||||||
|
14
src/normal.c
14
src/normal.c
@@ -5098,7 +5098,11 @@ dozet:
|
|||||||
|
|
||||||
/* "zm": fold more */
|
/* "zm": fold more */
|
||||||
case 'm': if (curwin->w_p_fdl > 0)
|
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 */
|
old_fdl = -1; /* force an update */
|
||||||
curwin->w_p_fen = TRUE;
|
curwin->w_p_fen = TRUE;
|
||||||
break;
|
break;
|
||||||
@@ -5110,7 +5114,13 @@ dozet:
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
/* "zr": reduce folding */
|
/* "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;
|
break;
|
||||||
|
|
||||||
/* "zR": open all folds */
|
/* "zR": open all folds */
|
||||||
|
@@ -741,6 +741,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
686,
|
||||||
/**/
|
/**/
|
||||||
685,
|
685,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user