comparison runtime/doc/options.txt @ 26743:c2c40cefc17b v8.2.3900

patch 8.2.3900: it is not easy to use a script-local function for an option Commit: https://github.com/vim/vim/commit/8bb65f230d3025037f34021a72616038da0601ee Author: Yegappan Lakshmanan <yegappan@yahoo.com> Date: Sun Dec 26 10:51:39 2021 +0000 patch 8.2.3900: it is not easy to use a script-local function for an option Problem: It is not easy to use a script-local function for an option. Solution: recognize s: and <SID> at the start of the expression. (Yegappan Lakshmanan, closes #9401)
author Bram Moolenaar <Bram@vim.org>
date Sun, 26 Dec 2021 12:00:04 +0100
parents f0d7cb510ce3
children dcd1c244e332
comparison
equal deleted inserted replaced
26742:00732e690ee8 26743:c2c40cefc17b
1223 NOTE: The balloon is displayed only if the cursor is on a text 1223 NOTE: The balloon is displayed only if the cursor is on a text
1224 character. If the result of evaluating 'balloonexpr' is not empty, 1224 character. If the result of evaluating 'balloonexpr' is not empty,
1225 Vim does not try to send a message to an external debugger (Netbeans 1225 Vim does not try to send a message to an external debugger (Netbeans
1226 or Sun Workshop). 1226 or Sun Workshop).
1227 1227
1228 If the expression starts with s: or |<SID>|, then it is replaced with
1229 the script ID (|local-function|). Example: >
1230 set bexpr=s:MyBalloonExpr()
1231 set bexpr=<SID>SomeBalloonExpr()
1232 <
1228 The expression will be evaluated in the |sandbox| when set from a 1233 The expression will be evaluated in the |sandbox| when set from a
1229 modeline, see |sandbox-option|. 1234 modeline, see |sandbox-option|.
1230 This option cannot be set in a modeline when 'modelineexpr' is off. 1235 This option cannot be set in a modeline when 'modelineexpr' is off.
1231 1236
1232 It is not allowed to change text or jump to another window while 1237 It is not allowed to change text or jump to another window while
3594 return "i" or "R" in this situation. 3599 return "i" or "R" in this situation.
3595 3600
3596 When the expression evaluates to non-zero Vim will fall back to using 3601 When the expression evaluates to non-zero Vim will fall back to using
3597 the internal format mechanism. 3602 the internal format mechanism.
3598 3603
3604 If the expression starts with s: or |<SID>|, then it is replaced with
3605 the script ID (|local-function|). Example: >
3606 set formatexpr=s:MyFormatExpr()
3607 set formatexpr=<SID>SomeFormatExpr()
3608 <
3599 The expression will be evaluated in the |sandbox| when set from a 3609 The expression will be evaluated in the |sandbox| when set from a
3600 modeline, see |sandbox-option|. That stops the option from working, 3610 modeline, see |sandbox-option|. That stops the option from working,
3601 since changing the buffer text is not allowed. 3611 since changing the buffer text is not allowed.
3602 This option cannot be set in a modeline when 'modelineexpr' is off. 3612 This option cannot be set in a modeline when 'modelineexpr' is off.
3603 NOTE: This option is set to "" when 'compatible' is set. 3613 NOTE: This option is set to "" when 'compatible' is set.
4436 4446
4437 Also used for the |gf| command if an unmodified file name can't be 4447 Also used for the |gf| command if an unmodified file name can't be
4438 found. Allows doing "gf" on the name after an 'include' statement. 4448 found. Allows doing "gf" on the name after an 'include' statement.
4439 Also used for |<cfile>|. 4449 Also used for |<cfile>|.
4440 4450
4451 If the expression starts with s: or |<SID>|, then it is replaced with
4452 the script ID (|local-function|). Example: >
4453 set includeexpr=s:MyIncludeExpr(v:fname)
4454 set includeexpr=<SID>SomeIncludeExpr(v:fname)
4455 <
4441 The expression will be evaluated in the |sandbox| when set from a 4456 The expression will be evaluated in the |sandbox| when set from a
4442 modeline, see |sandbox-option|. 4457 modeline, see |sandbox-option|.
4443 This option cannot be set in a modeline when 'modelineexpr' is off. 4458 This option cannot be set in a modeline when 'modelineexpr' is off.
4444 4459
4445 It is not allowed to change text or jump to another window while 4460 It is not allowed to change text or jump to another window while
4509 overridden by the Lisp indentation algorithm. 4524 overridden by the Lisp indentation algorithm.
4510 When 'paste' is set this option is not used for indenting. 4525 When 'paste' is set this option is not used for indenting.
4511 The expression is evaluated with |v:lnum| set to the line number for 4526 The expression is evaluated with |v:lnum| set to the line number for
4512 which the indent is to be computed. The cursor is also in this line 4527 which the indent is to be computed. The cursor is also in this line
4513 when the expression is evaluated (but it may be moved around). 4528 when the expression is evaluated (but it may be moved around).
4529 If the expression starts with s: or |<SID>|, then it is replaced with
4530 the script ID (|local-function|). Example: >
4531 set indentexpr=s:MyIndentExpr()
4532 set indentexpr=<SID>SomeIndentExpr()
4533 <
4514 The expression must return the number of spaces worth of indent. It 4534 The expression must return the number of spaces worth of indent. It
4515 can return "-1" to keep the current indent (this means 'autoindent' is 4535 can return "-1" to keep the current indent (this means 'autoindent' is
4516 used for the indent). 4536 used for the indent).
4517 Functions useful for computing the indent are |indent()|, |cindent()| 4537 Functions useful for computing the indent are |indent()|, |cindent()|
4518 and |lispindent()|. 4538 and |lispindent()|.