mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-24 09:48:42 +02:00
plugins: remove mkCompositeOptions from implementation
This commit is contained in:
parent
70b4e2d981
commit
d8cffe2ead
13 changed files with 607 additions and 681 deletions
|
@ -23,17 +23,15 @@ with lib; let
|
|||
"the button which is clicked to close / save a buffer, or indicate that it is pinned.";
|
||||
|
||||
diagnostics =
|
||||
helpers.mkCompositeOption "Diagnostics icons"
|
||||
genAttrs
|
||||
["error" "warn" "info" "hint"]
|
||||
(
|
||||
genAttrs
|
||||
["error" "warn" "info" "hint"]
|
||||
(
|
||||
name:
|
||||
helpers.mkCompositeOption "${name} diagnostic icon" {
|
||||
enable = helpers.defaultNullOpts.mkBool false "Enable the ${name} diagnostic symbol";
|
||||
icon = helpers.mkNullOrOption types.str "${name} diagnostic symbol";
|
||||
}
|
||||
)
|
||||
name:
|
||||
helpers.mkCompositeOption "${name} diagnostic icon." {
|
||||
enable = helpers.defaultNullOpts.mkBool false "Enable the ${name} diagnostic symbol";
|
||||
|
||||
icon = helpers.mkNullOrOption types.str "${name} diagnostic symbol";
|
||||
}
|
||||
);
|
||||
|
||||
filetype = {
|
||||
|
@ -250,7 +248,7 @@ in {
|
|||
buffer_index = bufferIndex;
|
||||
buffer_number = bufferNumber;
|
||||
inherit button;
|
||||
diagnostics = helpers.ifNonNull' bufferOption.diagnostics (
|
||||
diagnostics =
|
||||
/*
|
||||
Because the keys of this lua table are not strings (but
|
||||
`vim.diagnostic.severity.XXXX`), we have to manualy build a raw lua string here.
|
||||
|
@ -277,8 +275,7 @@ in {
|
|||
setIconsList
|
||||
)
|
||||
+ "}"
|
||||
)
|
||||
);
|
||||
);
|
||||
filetype = with filetype; {
|
||||
custom_color = customColors;
|
||||
enabled = enable;
|
||||
|
|
|
@ -240,19 +240,19 @@ in {
|
|||
|
||||
offsets = helpers.defaultNullOpts.mkNullable (types.listOf types.attrs) "null" "offsets";
|
||||
|
||||
groups = helpers.mkCompositeOption "groups" {
|
||||
groups = {
|
||||
items =
|
||||
helpers.defaultNullOpts.mkNullable (types.listOf types.attrs) "[]"
|
||||
"List of groups.";
|
||||
|
||||
options = helpers.mkCompositeOption "Group options" {
|
||||
options = {
|
||||
toggleHiddenOnEnter =
|
||||
helpers.defaultNullOpts.mkBool true
|
||||
"Re-open hidden groups on bufenter.";
|
||||
};
|
||||
};
|
||||
|
||||
hover = helpers.mkCompositeOption "Hover" {
|
||||
hover = {
|
||||
enabled = mkEnableOption "hover";
|
||||
|
||||
reveal = helpers.defaultNullOpts.mkNullable (types.listOf types.str) "[]" "reveal";
|
||||
|
@ -260,7 +260,7 @@ in {
|
|||
delay = helpers.defaultNullOpts.mkInt 200 "delay";
|
||||
};
|
||||
|
||||
debug = helpers.mkCompositeOption "Debug options" {
|
||||
debug = {
|
||||
logging = helpers.defaultNullOpts.mkBool false "Whether to enable logging";
|
||||
};
|
||||
|
||||
|
@ -319,14 +319,23 @@ in {
|
|||
diagnostics_indicator = helpers.mkRaw diagnosticsIndicator;
|
||||
diagnostics_update_in_insert = diagnosticsUpdateInInsert;
|
||||
inherit offsets;
|
||||
groups = helpers.ifNonNull' groups {
|
||||
groups = {
|
||||
inherit (groups) items;
|
||||
options = helpers.ifNonNull' groups.options {
|
||||
options = {
|
||||
toggle_hidden_on_enter = groups.options.toggleHiddenOnEnter;
|
||||
};
|
||||
};
|
||||
inherit hover;
|
||||
inherit debug;
|
||||
hover = {
|
||||
inherit
|
||||
(hover)
|
||||
enabled
|
||||
reveal
|
||||
delay
|
||||
;
|
||||
};
|
||||
debug = {
|
||||
inherit (debug) logging;
|
||||
};
|
||||
custom_filter = helpers.mkRaw customFilter;
|
||||
}
|
||||
// cfg.extraOptions;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue