mirror of
https://github.com/neovim/neovim.git
synced 2025-09-18 09:18:19 +00:00
vim-patch:7.4.686 #3629
Problem: "zr" and "zm" do not take a count.
Solution: Implement the count, restrict the fold level to the maximum
nesting depth. (Marcin Szamotulski)
7d2757a472
This commit is contained in:

committed by
Florian Walch

parent
cbb7044878
commit
f65e7bf30c
@@ -4253,8 +4253,13 @@ dozet:
|
||||
break;
|
||||
|
||||
/* "zm": fold more */
|
||||
case 'm': if (curwin->w_p_fdl > 0)
|
||||
--curwin->w_p_fdl;
|
||||
case 'm':
|
||||
if (curwin->w_p_fdl > 0) {
|
||||
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;
|
||||
@@ -4266,7 +4271,14 @@ 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 */
|
||||
|
Reference in New Issue
Block a user