mirror of
https://github.com/nix-community/nixvim.git
synced 2025-07-13 02:34:34 +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
|
@ -29,9 +29,9 @@ in {
|
|||
helpers.mkNullOrOption str
|
||||
"Specifies an alias under which to install the plugin";
|
||||
|
||||
installer = helpers.mkNullOrOption str "A custom installer";
|
||||
installer = helpers.defaultNullOpts.mkLuaFn "nil" "A custom installer";
|
||||
|
||||
updater = helpers.mkNullOrOption str "A custom updater";
|
||||
updater = helpers.defaultNullOpts.mkLuaFn "nil" "A custom updater";
|
||||
|
||||
after =
|
||||
helpers.mkNullOrOption (either str (listOf str))
|
||||
|
@ -157,14 +157,12 @@ in {
|
|||
then {
|
||||
"__unkeyed" = plugin.name;
|
||||
|
||||
inherit (plugin) disable as;
|
||||
|
||||
installer = helpers.mkRaw plugin.installer;
|
||||
|
||||
updater = helpers.mkRaw plugin.updater;
|
||||
|
||||
inherit
|
||||
(plugin)
|
||||
disable
|
||||
as
|
||||
installer
|
||||
updater
|
||||
after
|
||||
rtp
|
||||
opt
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue