diff options
author | Yegappan Lakshmanan <yegappan@yahoo.com> | 2021-12-26 10:51:39 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2021-12-26 10:51:39 +0000 |
commit | 8bb65f230d3025037f34021a72616038da0601ee (patch) | |
tree | 1edaf57b7fbe5e3c30a174026f5389f8b98b7376 /runtime/doc/fold.txt | |
parent | ec86520f946a40d5c4a92d6a11d6928faa13abd4 (diff) | |
download | vim-git-8bb65f230d3025037f34021a72616038da0601ee.tar.gz |
patch 8.2.3900: it is not easy to use a script-local function for an optionv8.2.3900
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)
Diffstat (limited to 'runtime/doc/fold.txt')
-rw-r--r-- | runtime/doc/fold.txt | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/runtime/doc/fold.txt b/runtime/doc/fold.txt index 274e472a5..56c3c75c3 100644 --- a/runtime/doc/fold.txt +++ b/runtime/doc/fold.txt @@ -121,6 +121,11 @@ method can be very slow! 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: > + set foldexpr=s:MyFoldExpr() + set foldexpr=<SID>SomeFoldExpr() +< An example of using "a1" and "s1": For a multi-line C comment, a line containing "/*" would return "a1" to start a fold, and a line containing "*/" would return "s1" to end the fold after that line: > @@ -543,6 +548,8 @@ A closed fold is indicated with a '+'. These characters can be changed with the 'fillchars' option. +These characters can be changed with the 'fillchars' option. + Where the fold column is too narrow to display all nested folds, digits are shown to indicate the nesting level. |