mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-21 08:35:43 +02:00
lib/options: mkEnum
quote default if string
As there's only a handful of call-sites to fix, ensure all `mkEnum` defaults are passed in as the correct type (tree wide) and change `mkEnum` to now correctly render string-type defaults "quoted" (like `mkString` does).
This commit is contained in:
parent
993deb227e
commit
ff1ab1700c
3 changed files with 11 additions and 8 deletions
|
@ -120,7 +120,12 @@ rec {
|
||||||
mkAttributeSet = default: mkNullable nixvimTypes.attrs ''${default}'';
|
mkAttributeSet = default: mkNullable nixvimTypes.attrs ''${default}'';
|
||||||
mkListOf = ty: default: mkNullable (with nixvimTypes; listOf (maybeRaw ty)) default;
|
mkListOf = ty: default: mkNullable (with nixvimTypes; listOf (maybeRaw ty)) default;
|
||||||
mkAttrsOf = ty: default: mkNullable (with nixvimTypes; attrsOf (maybeRaw ty)) default;
|
mkAttrsOf = ty: default: mkNullable (with nixvimTypes; attrsOf (maybeRaw ty)) default;
|
||||||
mkEnum = enumValues: default: mkNullableWithRaw (types.enum enumValues) ''"${default}"'';
|
mkEnum =
|
||||||
|
enumValues: default:
|
||||||
|
mkNullableWithRaw (types.enum enumValues) (
|
||||||
|
# TODO we should remove this once `mkDefaultDesc` no longer has a special case
|
||||||
|
if isString default then generators.toPretty { } default else default
|
||||||
|
);
|
||||||
mkEnumFirstDefault = enumValues: mkEnum enumValues (head enumValues);
|
mkEnumFirstDefault = enumValues: mkEnum enumValues (head enumValues);
|
||||||
mkBorder =
|
mkBorder =
|
||||||
default: name: desc:
|
default: name: desc:
|
||||||
|
|
|
@ -51,7 +51,7 @@ in
|
||||||
1
|
1
|
||||||
2
|
2
|
||||||
]
|
]
|
||||||
"1"
|
1
|
||||||
''
|
''
|
||||||
Change to 0 if you want to save memory, but having multiple ccls processes operating in the
|
Change to 0 if you want to save memory, but having multiple ccls processes operating in the
|
||||||
same directory may corrupt ccls's in-memory representation of the index.
|
same directory may corrupt ccls's in-memory representation of the index.
|
||||||
|
@ -206,7 +206,7 @@ in
|
||||||
1
|
1
|
||||||
2
|
2
|
||||||
]
|
]
|
||||||
"2"
|
2
|
||||||
''
|
''
|
||||||
`ccls` can index the contents of comments associated with functions/types/variables (macros
|
`ccls` can index the contents of comments associated with functions/types/variables (macros
|
||||||
are not handled).
|
are not handled).
|
||||||
|
@ -218,12 +218,11 @@ in
|
||||||
'';
|
'';
|
||||||
|
|
||||||
multiVersion =
|
multiVersion =
|
||||||
helpers.defaultNullOpts.mkEnum
|
helpers.defaultNullOpts.mkEnumFirstDefault
|
||||||
[
|
[
|
||||||
0
|
0
|
||||||
1
|
1
|
||||||
]
|
]
|
||||||
"0"
|
|
||||||
''
|
''
|
||||||
Index a file only once (`0`), or in each translation unit that includes it (`1`).
|
Index a file only once (`0`), or in each translation unit that includes it (`1`).
|
||||||
|
|
||||||
|
@ -282,7 +281,7 @@ in
|
||||||
1
|
1
|
||||||
2
|
2
|
||||||
]
|
]
|
||||||
"2"
|
2
|
||||||
''
|
''
|
||||||
Determine whether a file should be re-indexed when any of its dependencies changes
|
Determine whether a file should be re-indexed when any of its dependencies changes
|
||||||
timestamp.
|
timestamp.
|
||||||
|
|
|
@ -129,12 +129,11 @@ mkVimPlugin config {
|
||||||
'';
|
'';
|
||||||
|
|
||||||
output_win_style =
|
output_win_style =
|
||||||
helpers.defaultNullOpts.mkEnum
|
helpers.defaultNullOpts.mkEnumFirstDefault
|
||||||
[
|
[
|
||||||
false
|
false
|
||||||
"minimal"
|
"minimal"
|
||||||
]
|
]
|
||||||
"false"
|
|
||||||
''
|
''
|
||||||
Value passed to the style option in `:h nvim_open_win()`.
|
Value passed to the style option in `:h nvim_open_win()`.
|
||||||
'';
|
'';
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue