diff options
author | Bram Moolenaar <Bram@vim.org> | 2015-03-31 17:46:22 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2015-03-31 17:46:22 +0200 |
commit | 7d2757a47204d00cd47e3db94f1bd248c499d4e3 (patch) | |
tree | 9532b358350513ba47c4700fc82962ed58c67551 /src | |
parent | 0e462411cafdd908356792b2c229ab6369103bca (diff) | |
download | vim-git-7d2757a47204d00cd47e3db94f1bd248c499d4e3.tar.gz |
updated for version 7.4.686v7.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)
Diffstat (limited to 'src')
-rw-r--r-- | src/normal.c | 14 | ||||
-rw-r--r-- | src/version.c | 2 |
2 files changed, 14 insertions, 2 deletions
diff --git a/src/normal.c b/src/normal.c index d173c737b..c29ab1a48 100644 --- a/src/normal.c +++ b/src/normal.c @@ -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 */ diff --git a/src/version.c b/src/version.c index 6156c3731..89e70848a 100644 --- a/src/version.c +++ b/src/version.c @@ -742,6 +742,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 686, +/**/ 685, /**/ 684, |