lib/options: add defaultNullOpts.mkFloat

This commit is contained in:
Gaetan Lepage 2025-01-04 00:15:16 +01:00
parent 24ac8f651d
commit 91227dca9e
3 changed files with 4 additions and 2 deletions

View file

@ -167,6 +167,8 @@ rec {
mkNum' = args: mkNullableWithRaw' (args // { type = types.number; });
mkNum = pluginDefault: description: mkNum' { inherit pluginDefault description; };
mkFloat' = args: mkNullableWithRaw' (args // { type = types.float; });
mkFloat = pluginDefault: description: mkFloat' { inherit pluginDefault description; };
mkProportion' = args: mkNullableWithRaw' (args // { type = types.numbers.between 0.0 1.0; });
mkProportion = pluginDefault: description: mkProportion' { inherit pluginDefault description; };
mkInt' = args: mkNullableWithRaw' (args // { type = types.int; });

View file

@ -181,7 +181,7 @@ lib.nixvim.plugins.mkNeovimPlugin {
];
};
float_precision = defaultNullOpts.mkNullable types.float 0.01 ''
float_precision = defaultNullOpts.mkFloat 0.01 ''
Can limit the number of decimals displayed for floats.
'';
};

View file

@ -52,7 +52,7 @@ lib.nixvim.plugins.mkNeovimPlugin {
as allowing this plugin to provide logical defaults for a "batteries included" experience.
'';
max_file_size = defaultNullOpts.mkNullable types.float 10.0 ''
max_file_size = defaultNullOpts.mkFloat 10.0 ''
The maximum file size that this plugin will attempt to render in megabytes.
This plugin only does rendering for what is visible within the viewport so the size of the