mirror of
https://github.com/nix-community/nixvim.git
synced 2025-08-29 22:30:13 +02:00
plugins: Introduce helpers.defaultNullOpts.mkLuaFn (#855)
This allows to avoid calling `mkRaw` on lua functions, as they will get applied automatically. This could also help in the future to refactor the use of Lua code to make it more user-friendly.
This commit is contained in:
parent
b38dbdb0dc
commit
1d8e7906c9
30 changed files with 140 additions and 119 deletions
|
@ -20,7 +20,7 @@ in {
|
|||
while opening the folded line, `0` value will disable the highlight
|
||||
'';
|
||||
|
||||
providerSelector = helpers.defaultNullOpts.mkStr "null" ''
|
||||
providerSelector = helpers.defaultNullOpts.mkLuaFn "null" ''
|
||||
A lua function as a selector for fold providers.
|
||||
'';
|
||||
|
||||
|
@ -31,7 +31,7 @@ in {
|
|||
run `UfoInspect` for details if your provider has extended the kinds.
|
||||
'';
|
||||
|
||||
foldVirtTextHandler = helpers.defaultNullOpts.mkStr "null" "A lua function to customize fold virtual text";
|
||||
foldVirtTextHandler = helpers.defaultNullOpts.mkLuaFn "null" "A lua function to customize fold virtual text";
|
||||
|
||||
enableGetFoldVirtText = helpers.defaultNullOpts.mkBool false ''
|
||||
Enable a function with `lnum` as a parameter to capture the virtual text
|
||||
|
@ -58,9 +58,9 @@ in {
|
|||
options = with cfg;
|
||||
{
|
||||
open_fold_hl_timeout = openFoldHlTimeout;
|
||||
provider_selector = helpers.mkRaw providerSelector;
|
||||
provider_selector = providerSelector;
|
||||
close_fold_kinds = closeFoldKinds;
|
||||
fold_virt_text_handler = helpers.mkRaw foldVirtTextHandler;
|
||||
fold_virt_text_handler = foldVirtTextHandler;
|
||||
enable_get_fold_virt_text = enableGetFoldVirtText;
|
||||
|
||||
preview = with preview; {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue