diff options
author | Yegappan Lakshmanan <yegappan@yahoo.com> | 2021-12-26 21:54:43 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2021-12-26 21:54:43 +0000 |
commit | 27708e6c7b6f444fd599f3dc5015336b002b874d (patch) | |
tree | ca58fb2aa05c18a8149600a23c08603a19e02caa /runtime/doc/fold.txt | |
parent | c553a21e189aa440515a19c5b25f8b6b50c5d53d (diff) |
patch 8.2.3908: cannot use a script-local function for 'foldtext'v8.2.3908
Problem: Cannot use a script-local function for 'foldtext'.
Solution: Expand "s:" and "<SID>". (Yegappan Lakshmanan, closes #9411)
Diffstat (limited to 'runtime/doc/fold.txt')
-rw-r--r-- | runtime/doc/fold.txt | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/runtime/doc/fold.txt b/runtime/doc/fold.txt index 56c3c75c35..cac76bad98 100644 --- a/runtime/doc/fold.txt +++ b/runtime/doc/fold.txt @@ -122,7 +122,7 @@ Try to avoid the "=", "a" and "s" return values, since Vim often has to search backwards for a line for which the fold level is defined. This can be slow. If the 'foldexpr' expression starts with s: or |<SID>|, then it is replaced -with the script ID (|local-function|). Example: > +with the script ID (|local-function|). Examples: > set foldexpr=s:MyFoldExpr() set foldexpr=<SID>SomeFoldExpr() < @@ -529,6 +529,11 @@ The resulting line is truncated to fit in the window, it never wraps. When there is room after the text, it is filled with the character specified by 'fillchars'. +If the 'foldtext' expression starts with s: or |<SID>|, then it is replaced +with the script ID (|local-function|). Examples: > + set foldtext=s:MyFoldText() + set foldtext=<SID>SomeFoldText() +< Note that backslashes need to be used for characters that the ":set" command handles differently: Space, backslash and double-quote. |option-backslash| |