From c4ee5c56229dceb15176e9590eb105f4909c2337 Mon Sep 17 00:00:00 2001 From: NotAShelf Date: Fri, 10 Jan 2025 13:28:07 +0300 Subject: [PATCH] statusline/feline: add components --- modules/plugins/statusline/feline/feline.nix | 21 +++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/modules/plugins/statusline/feline/feline.nix b/modules/plugins/statusline/feline/feline.nix index e362e5c0..9d144722 100644 --- a/modules/plugins/statusline/feline/feline.nix +++ b/modules/plugins/statusline/feline/feline.nix @@ -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,10 +119,25 @@ 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. + compontents = { + 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'"; + }; }; }; };