From 79a69337682ca0e3fc4d0bb9f70d851f8114bc9a Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Mon, 17 Apr 2023 15:32:49 +0800 Subject: [PATCH] vim-patch:partial:6f4754b9f725 Update runtime files https://github.com/vim/vim/commit/6f4754b9f7253d7e4ba527064a24aff1acdb1e8f Co-authored-by: Bram Moolenaar --- runtime/doc/diff.txt | 9 +++++++-- runtime/doc/options.txt | 21 ++++++++++++++++----- 2 files changed, 23 insertions(+), 7 deletions(-) diff --git a/runtime/doc/diff.txt b/runtime/doc/diff.txt index ead68c5f4f..2f174a404e 100644 --- a/runtime/doc/diff.txt +++ b/runtime/doc/diff.txt @@ -396,7 +396,9 @@ If the 'diffexpr' expression starts with s: or ||, then it is replaced with the script ID (|local-function|). Example: > set diffexpr=s:MyDiffExpr() set diffexpr=SomeDiffExpr() -< +Otherwise, the expression is evaluated in the context of the script where the +option was set, thus script-local items are available. + *E810* *E97* Vim will do a test if the diff output looks alright. If it doesn't, you will get an error message. Possible causes: @@ -452,5 +454,8 @@ If the 'patchexpr' expression starts with s: or ||, then it is replaced with the script ID (|local-function|). Example: > set patchexpr=s:MyPatchExpr() set patchexpr=SomePatchExpr() -< +Otherwise, the expression is evaluated in the context of the script where the +option was set, thus script-local items are available. + + vim:tw=78:ts=8:noet:ft=help:norl: diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt index dcaf37af20..7842394245 100644 --- a/runtime/doc/options.txt +++ b/runtime/doc/options.txt @@ -2563,7 +2563,9 @@ A jump table for the options with a short description can be found at |Q_op|. 'foldexpr' 'fde' string (default: "0") local to window The expression used for when 'foldmethod' is "expr". It is evaluated - for each line to obtain its fold level. See |fold-expr|. + for each line to obtain its fold level. The context is set to the + script where 'foldexpr' was set, script-local items can be accessed. + See |fold-expr| for the usage. The expression will be evaluated in the |sandbox| if set from a modeline, see |sandbox-option|. @@ -2679,7 +2681,9 @@ A jump table for the options with a short description can be found at |Q_op|. 'foldtext' 'fdt' string (default: "foldtext()") local to window An expression which is used to specify the text displayed for a closed - fold. See |fold-foldtext|. + fold. The context is set to the script where 'foldexpr' was set, + script-local items can be accessed. See |fold-foldtext| for the + usage. The expression will be evaluated in the |sandbox| if set from a modeline, see |sandbox-option|. @@ -2720,7 +2724,9 @@ A jump table for the options with a short description can be found at |Q_op|. the script ID (|local-function|). Example: > set formatexpr=s:MyFormatExpr() set formatexpr=SomeFormatExpr() -< +< Otherwise, the expression is evaluated in the context of the script + where the option was set, thus script-local items are available. + The expression will be evaluated in the |sandbox| when set from a modeline, see |sandbox-option|. That stops the option from working, since changing the buffer text is not allowed. @@ -3334,7 +3340,9 @@ A jump table for the options with a short description can be found at |Q_op|. the script ID (|local-function|). Example: > setlocal includeexpr=s:MyIncludeExpr(v:fname) setlocal includeexpr=SomeIncludeExpr(v:fname) -< +< Otherwise, the expression is evaluated in the context of the script + where the option was set, thus script-local items are available. + The expression will be evaluated in the |sandbox| when set from a modeline, see |sandbox-option|. This option cannot be set in a modeline when 'modelineexpr' is off. @@ -3389,11 +3397,14 @@ A jump table for the options with a short description can be found at |Q_op|. The expression is evaluated with |v:lnum| set to the line number for which the indent is to be computed. The cursor is also in this line when the expression is evaluated (but it may be moved around). + If the expression starts with s: or ||, then it is replaced with the script ID (|local-function|). Example: > set indentexpr=s:MyIndentExpr() set indentexpr=SomeIndentExpr() -< +< Otherwise, the expression is evaluated in the context of the script + where the option was set, thus script-local items are available. + The expression must return the number of spaces worth of indent. It can return "-1" to keep the current indent (this means 'autoindent' is used for the indent).