mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-20 16:15:43 +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;
|
||||
|
||||
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 { };
|
||||
|
||||
# NOTE: options that have the deprecated `lua` sub-option must use `removeDeprecatedMapAttrs`
|
||||
|
@ -55,7 +64,7 @@ rec {
|
|||
mkModeOption =
|
||||
default:
|
||||
lib.mkOption {
|
||||
type = with lib.types; either modeEnum (listOf modeEnum);
|
||||
type = modeType;
|
||||
description = ''
|
||||
One or several modes.
|
||||
Use the short-names (`"n"`, `"v"`, ...).
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue