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)
This commit is contained in:
Yegappan Lakshmanan
2021-12-26 10:51:39 +00:00
committed by Bram Moolenaar
parent ec86520f94
commit 8bb65f230d
13 changed files with 265 additions and 8 deletions

View File

@ -174,6 +174,11 @@ an error message. In that case Vim will delete the file. In the default
value for non-MS-Windows a trick is used: Adding "v:shell_error" will result
in a non-zero number when the system() call fails.
If the expression starts with s: or |<SID>|, then it is replaced with the
script ID (|local-function|). Example: >
set printexpr=s:MyPrintFile()
set printexpr=<SID>SomePrintFile()
<
This option cannot be set from a |modeline| or in the |sandbox|, for security
reasons.