From 6e979dbe94d94c83dba193ffb550f9709cead6cf Mon Sep 17 00:00:00 2001 From: Matt Sturgeon Date: Tue, 11 Jun 2024 02:31:02 +0100 Subject: [PATCH] plugins/barbar: switch from `mkDesc` to `pluginDefaultText` --- plugins/bufferlines/barbar.nix | 79 +++++++++++++++++----------------- 1 file changed, 40 insertions(+), 39 deletions(-) diff --git a/plugins/bufferlines/barbar.nix b/plugins/bufferlines/barbar.nix index 6a11096a..25bfc20a 100644 --- a/plugins/bufferlines/barbar.nix +++ b/plugins/bufferlines/barbar.nix @@ -314,7 +314,7 @@ helpers.neovim-plugin.mkNeovimPlugin config { Use `false` to disable it. ''; - diagnostics = mkOption { + diagnostics = mkOption rec { type = types.submodule { freeformType = with types; attrsOf anything; options = @@ -338,45 +338,46 @@ helpers.neovim-plugin.mkNeovimPlugin config { }; apply = helpers.toRawKeys; default = { }; - description = - helpers.defaultNullOpts.mkDesc - { - "vim.diagnostic.severity.ERROR" = { - enabled = false; - icon = " "; - }; - "vim.diagnostic.severity.HINT" = { - enabled = false; - icon = "󰌶 "; - }; - "vim.diagnostic.severity.INFO" = { - enabled = false; - icon = " "; - }; - "vim.diagnostic.severity.WARN" = { - enabled = false; - icon = " "; - }; - } - '' - Set the icon for each diagnostic level. + defaultText = helpers.pluginDefaultText { + inherit default; + pluginDefault = { + "vim.diagnostic.severity.ERROR" = { + enabled = false; + icon = " "; + }; + "vim.diagnostic.severity.HINT" = { + enabled = false; + icon = "󰌶 "; + }; + "vim.diagnostic.severity.INFO" = { + enabled = false; + icon = " "; + }; + "vim.diagnostic.severity.WARN" = { + enabled = false; + icon = " "; + }; + }; + }; + description = '' + Set the icon for each diagnostic level. - The keys will be automatically translated to raw lua: - ```nix - { - "vim.diagnostic.severity.INFO".enabled = true; - "vim.diagnostic.severity.WARN".enabled = true; - } - ``` - will result in the following lua: - ```lua - { - -- Note the table keys are not string literals: - [vim.diagnostic.severity.INFO] = { ['enabled'] = true }, - [vim.diagnostic.severity.WARN] = { ['enabled'] = true }, - } - ``` - ''; + The keys will be automatically translated to raw lua: + ```nix + { + "vim.diagnostic.severity.INFO".enabled = true; + "vim.diagnostic.severity.WARN".enabled = true; + } + ``` + will result in the following lua: + ```lua + { + -- Note the table keys are not string literals: + [vim.diagnostic.severity.INFO] = { ['enabled'] = true }, + [vim.diagnostic.severity.WARN] = { ['enabled'] = true }, + } + ``` + ''; }; gitsigns =