mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-21 00:25:42 +02:00
lib/keymaps: make mode
type's description more readable
Only list the enum values once, instead of twice.
This commit is contained in:
parent
bd46d896a8
commit
b8c5587399
1 changed files with 10 additions and 1 deletions
|
@ -44,6 +44,15 @@ rec {
|
||||||
|
|
||||||
modeEnum = lib.types.enum modes;
|
modeEnum = lib.types.enum modes;
|
||||||
|
|
||||||
|
modeType =
|
||||||
|
with lib.types;
|
||||||
|
either modeEnum (nonEmptyListOf modeEnum)
|
||||||
|
// {
|
||||||
|
description =
|
||||||
|
"one of or non-empty list of" + lib.strings.removePrefix "one of" modeEnum.description;
|
||||||
|
descriptionClass = "conjunction";
|
||||||
|
};
|
||||||
|
|
||||||
mapOptionSubmodule = mkMapOptionSubmodule { };
|
mapOptionSubmodule = mkMapOptionSubmodule { };
|
||||||
|
|
||||||
# NOTE: options that have the deprecated `lua` sub-option must use `removeDeprecatedMapAttrs`
|
# NOTE: options that have the deprecated `lua` sub-option must use `removeDeprecatedMapAttrs`
|
||||||
|
@ -55,7 +64,7 @@ rec {
|
||||||
mkModeOption =
|
mkModeOption =
|
||||||
default:
|
default:
|
||||||
lib.mkOption {
|
lib.mkOption {
|
||||||
type = with lib.types; either modeEnum (listOf modeEnum);
|
type = modeType;
|
||||||
description = ''
|
description = ''
|
||||||
One or several modes.
|
One or several modes.
|
||||||
Use the short-names (`"n"`, `"v"`, ...).
|
Use the short-names (`"n"`, `"v"`, ...).
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue