diff options
author | Bram Moolenaar <Bram@vim.org> | 2021-02-01 19:24:55 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2021-02-01 19:24:55 +0100 |
commit | f9547eb6ef02e305203b859d2dcfdae930b9d544 (patch) | |
tree | 825661ccdf026bb8e954912baaae39acd1d8d540 /src/fold.c | |
parent | 5daa91162699e4f8b54f9d1caaaab2715038941c (diff) | |
download | vim-git-f9547eb6ef02e305203b859d2dcfdae930b9d544.tar.gz |
patch 8.2.2447: 'foldlevel' not applied to folds restored from sessionv8.2.2447
Problem: 'foldlevel' not applied to folds restored from session.
Solution: Set 'foldlevel' after creaiting the folds. (closes #7767)
Diffstat (limited to 'src/fold.c')
-rw-r--r-- | src/fold.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/fold.c b/src/fold.c index f889f4c74..75b436a67 100644 --- a/src/fold.c +++ b/src/fold.c @@ -3309,7 +3309,7 @@ foldlevelExpr(fline_T *flp) // KeyTyped may be reset to 0 when calling a function which invokes // do_cmdline(). To make 'foldopen' work correctly restore KeyTyped. save_keytyped = KeyTyped; - n = (int)eval_foldexpr(flp->wp->w_p_fde, &c); + n = eval_foldexpr(flp->wp->w_p_fde, &c); KeyTyped = save_keytyped; switch (c) @@ -3526,7 +3526,8 @@ put_folds(FILE *fd, win_T *wp) if (foldmethodIsManual(wp)) { if (put_line(fd, "silent! normal! zE") == FAIL - || put_folds_recurse(fd, &wp->w_folds, (linenr_T)0) == FAIL) + || put_folds_recurse(fd, &wp->w_folds, (linenr_T)0) == FAIL + || put_line(fd, "let &fdl = &fdl") == FAIL) return FAIL; } |