diff options
author | zeertzjq <zeertzjq@outlook.com> | 2024-08-02 12:16:04 +0800 |
---|---|---|
committer | zeertzjq <zeertzjq@outlook.com> | 2024-08-02 12:56:57 +0800 |
commit | 99bb0a10d3400ee8b9b2773d51a957dacbf52b33 (patch) | |
tree | 075b4793350d5bef55da000f89d75d90ecfc7c7e /runtime/doc/options.txt | |
parent | 6d722f33098da447ac29496b71dd58f2ae337996 (diff) | |
download | rneovim-99bb0a10d3400ee8b9b2773d51a957dacbf52b33.tar.gz rneovim-99bb0a10d3400ee8b9b2773d51a957dacbf52b33.tar.bz2 rneovim-99bb0a10d3400ee8b9b2773d51a957dacbf52b33.zip |
refactor(eval): treat v:lua call as simple function
Diffstat (limited to 'runtime/doc/options.txt')
-rw-r--r-- | runtime/doc/options.txt | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt index b4eb3b6f28..bc2a8ae263 100644 --- a/runtime/doc/options.txt +++ b/runtime/doc/options.txt @@ -406,7 +406,14 @@ The value of a few options, such as 'foldexpr', is an expression that is evaluated to get a value. The evaluation can have quite a bit of overhead. One way to minimize the overhead, and also to keep the option value very simple, is to define a function and set the option to call it without -arguments. +arguments. A |v:lua-call| can also be used. Example: >vim + lua << EOF + function _G.MyFoldFunc() + -- ... compute fold level for line v:lnum + return level + end + EOF + set foldexpr=v:lua.MyFoldFunc() Setting the filetype |