comparison src/fold.c @ 23812:84089558c5df v8.2.2447

patch 8.2.2447: 'foldlevel' not applied to folds restored from session Commit: https://github.com/vim/vim/commit/f9547eb6ef02e305203b859d2dcfdae930b9d544 Author: Bram Moolenaar <Bram@vim.org> Date: Mon Feb 1 19:24:55 2021 +0100 patch 8.2.2447: 'foldlevel' not applied to folds restored from session Problem: 'foldlevel' not applied to folds restored from session. Solution: Set 'foldlevel' after creaiting the folds. (closes https://github.com/vim/vim/issues/7767)
author Bram Moolenaar <Bram@vim.org>
date Mon, 01 Feb 2021 19:30:04 +0100
parents ef4f890f02f6
children 8f2262c72178
comparison
equal deleted inserted replaced
23811:e68d84effb68 23812:84089558c5df
3307 flp->lvl = 0; 3307 flp->lvl = 0;
3308 3308
3309 // KeyTyped may be reset to 0 when calling a function which invokes 3309 // KeyTyped may be reset to 0 when calling a function which invokes
3310 // do_cmdline(). To make 'foldopen' work correctly restore KeyTyped. 3310 // do_cmdline(). To make 'foldopen' work correctly restore KeyTyped.
3311 save_keytyped = KeyTyped; 3311 save_keytyped = KeyTyped;
3312 n = (int)eval_foldexpr(flp->wp->w_p_fde, &c); 3312 n = eval_foldexpr(flp->wp->w_p_fde, &c);
3313 KeyTyped = save_keytyped; 3313 KeyTyped = save_keytyped;
3314 3314
3315 switch (c) 3315 switch (c)
3316 { 3316 {
3317 // "a1", "a2", .. : add to the fold level 3317 // "a1", "a2", .. : add to the fold level
3524 put_folds(FILE *fd, win_T *wp) 3524 put_folds(FILE *fd, win_T *wp)
3525 { 3525 {
3526 if (foldmethodIsManual(wp)) 3526 if (foldmethodIsManual(wp))
3527 { 3527 {
3528 if (put_line(fd, "silent! normal! zE") == FAIL 3528 if (put_line(fd, "silent! normal! zE") == FAIL
3529 || put_folds_recurse(fd, &wp->w_folds, (linenr_T)0) == FAIL) 3529 || put_folds_recurse(fd, &wp->w_folds, (linenr_T)0) == FAIL
3530 || put_line(fd, "let &fdl = &fdl") == FAIL)
3530 return FAIL; 3531 return FAIL;
3531 } 3532 }
3532 3533
3533 // If some folds are manually opened/closed, need to restore that. 3534 // If some folds are manually opened/closed, need to restore that.
3534 if (wp->w_fold_manual) 3535 if (wp->w_fold_manual)