foldcolumn: allow auto:X

Similar to signcolumn, allow foldcolumn to adapt itself to the number of
folds.

Regression:
vim supports a maximum fdc of 12, this limits it to 9.
This commit is contained in:
Matthieu Coudron
2020-01-14 19:50:30 +01:00
parent 49cd750d6a
commit 1a2be57da3
15 changed files with 144 additions and 44 deletions

View File

@@ -4458,16 +4458,16 @@ dozet:
case 'r':
curwin->w_p_fdl += cap->count1;
{
int d = getDeepestNesting();
int d = getDeepestNesting(curwin);
if (curwin->w_p_fdl >= d) {
curwin->w_p_fdl = d;
}
}
break;
/* "zR": open all folds */
case 'R': curwin->w_p_fdl = getDeepestNesting();
old_fdl = -1; /* force an update */
case 'R': // "zR": open all folds
curwin->w_p_fdl = getDeepestNesting(curwin);
old_fdl = -1; // force an update
break;
case 'j': /* "zj" move to next fold downwards */