plugins/nvim-tree: fix option types

This commit is contained in:
Gaetan Lepage 2023-10-09 15:51:31 +02:00 committed by Gaétan Lepage
parent eab342e2bb
commit 0d8da0fcfb

View file

@ -373,24 +373,29 @@ in {
width =
helpers.defaultNullOpts.mkNullable
(types.oneOf [
types.str
types.int
(types.submodule {
options = let
strOrInt = types.either types.str types.int;
in {
min = helpers.defaultNullOpts.mkNullable strOrInt "30" "Minimum dynamic width.";
(with types;
oneOf [
str
int
(submodule {
options = let
strOrInt = either str int;
in {
# TODO check type
min = helpers.defaultNullOpts.mkNullable strOrInt "30" "Minimum dynamic width.";
max = helpers.defaultNullOpts.mkNullable strOrInt "-1" ''
Maximum dynamic width, -1 for unbounded.
'';
padding = helpers.defaultNullOpts.mkNullable strOrInt "1" ''
Extra padding to the right.
'';
};
})
])
max = helpers.defaultNullOpts.mkNullable strOrInt "-1" ''
Maximum dynamic width, -1 for unbounded.
'';
padding =
helpers.defaultNullOpts.mkNullable
(either ints.unsigned helpers.rawType)
"1"
"Extra padding to the right.";
};
})
])
"30"
''
Width of the window: can be a `%` string, a number representing columns or a table.