mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-28 03:20:08 +02:00
helpers: Add option helpers for types that are either a lua str or a value (#876)
Those types needed the following code in apply: if builtins.isString value then mkRaw value else value This commit avoids this boilerplate, and clarifies that the `str` is lua code in the documentation.
This commit is contained in:
parent
8b8a1c0f4b
commit
8aa4b7e4ce
13 changed files with 109 additions and 129 deletions
|
@ -769,8 +769,8 @@ in {
|
|||
"This is determined automatically, you probably don't need to set it";
|
||||
|
||||
findArgs =
|
||||
helpers.mkNullOrOption
|
||||
(types.either types.str (types.submodule {
|
||||
helpers.mkNullOrStrLuaFnOr
|
||||
(types.submodule {
|
||||
options = {
|
||||
fd =
|
||||
helpers.defaultNullOpts.mkNullable (types.listOf types.str)
|
||||
|
@ -784,7 +784,7 @@ in {
|
|||
''
|
||||
"You can specify extra args to pass to the find command.";
|
||||
};
|
||||
}))
|
||||
})
|
||||
''
|
||||
Find arguments
|
||||
|
||||
|
@ -1154,10 +1154,7 @@ in {
|
|||
};
|
||||
find_by_full_path_words = findByFullPathWords;
|
||||
find_command = findCommand;
|
||||
find_args =
|
||||
if isString findArgs
|
||||
then mkRaw findArgs
|
||||
else findArgs;
|
||||
find_args = findArgs;
|
||||
group_empty_dirs = groupEmptyDirs;
|
||||
search_limit = searchLimit;
|
||||
follow_current_file = followCurrentFile;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue