statusline/feline: add components

This commit is contained in:
NotAShelf 2025-01-10 13:28:07 +03:00
parent 970af589ad
commit b3b8d3a86c
No known key found for this signature in database
GPG key ID: EED98D11B85A2819

View file

@ -5,7 +5,7 @@
}: let
inherit (builtins) elem;
inherit (lib.options) mkOption mkEnableOption literalExpression;
inherit (lib.types) str listOf attrsOf anything either submodule;
inherit (lib.types) str listOf attrs attrsOf anything either submodule;
inherit (lib.lists) optional;
inherit (lib.generators) mkLuaInline;
inherit (lib.nvim.types) mkPluginSetupOption;
@ -119,11 +119,26 @@ in {
mode using `require('feline.providers.vi_mode').get_mode_color()`.
See `:help feline-vi-mode` for more details on vi mode.
'';
};
# TODO:
# - Check for the number of elements in the list maybe? Can Feline have infinite components per section?
# - type-check contents of `attrsOf anything`? Is there a downside for not doing that?
# - add examples for each one of those components. The option types are necessary, but confusing.
components = {
active = mkOption {
type = listOf (listOf (attrsOf anything));
default = [];
description = "List of components to display for buffers feline will render as 'active'";
};
inactive = mkOption {
type = listOf (listOf (attrsOf anything));
default = [];
description = "List of components to display for buffers feline will render as 'inactive'";
};
};
};
};
}