vim-patch:8.2.4173: cannot use an import in 'foldexpr' (#25215)

Problem:    Cannot use an import in 'foldexpr'.
Solution:   Set the script context to where 'foldexpr' was set. (closes vim/vim#9584)
            Fix that the script context was not set for all buffers.

e70dd11ef4

Co-authored-by: Bram Moolenaar <Bram@vim.org>
This commit is contained in:
zeertzjq
2023-09-17 21:01:19 +08:00
committed by GitHub
parent 71530cc972
commit 211edceb4f
3 changed files with 10 additions and 3 deletions

View File

@@ -1967,6 +1967,10 @@ void set_option_sctx_idx(int opt_idx, int opt_flags, sctx_T script_ctx)
curbuf->b_p_script_ctx[indir & PV_MASK] = last_set;
} else if (indir & PV_WIN) {
curwin->w_p_script_ctx[indir & PV_MASK] = last_set;
if (both) {
// also setting the "all buffers" value
curwin->w_allbuf_opt.wo_script_ctx[indir & PV_MASK] = last_set;
}
}
}
}