From 7931d08f5ad82c5e63592eb295d78eaf6e1a07d2 Mon Sep 17 00:00:00 2001 From: poz Date: Tue, 12 May 2026 20:23:50 +0200 Subject: [PATCH] visuals/fidget-nvim: update setupOpts to match upstream --- docs/manual/release-notes/rl-0.9.md | 1 + modules/plugins/filetree/nvimtree/config.nix | 2 + .../plugins/visuals/fidget-nvim/fidget.nix | 117 +++++++++++++++--- 3 files changed, 102 insertions(+), 18 deletions(-) diff --git a/docs/manual/release-notes/rl-0.9.md b/docs/manual/release-notes/rl-0.9.md index ffdccb8e..5801370e 100644 --- a/docs/manual/release-notes/rl-0.9.md +++ b/docs/manual/release-notes/rl-0.9.md @@ -475,6 +475,7 @@ https://github.com/gorbit99/codewindow.nvim - Add CMake support with [neocmakelsp]. - Add Arduino support with [arduino-language-server]. - Add GLSL support with [glsl_analyzer]. +- Update fidget-nvim setupOpts and fix NvimTree issue. [itscrystalline](https://github.com/itscrystalline): diff --git a/modules/plugins/filetree/nvimtree/config.nix b/modules/plugins/filetree/nvimtree/config.nix index 0d0381a0..b6faed56 100644 --- a/modules/plugins/filetree/nvimtree/config.nix +++ b/modules/plugins/filetree/nvimtree/config.nix @@ -19,6 +19,8 @@ in { "t" = "+NvimTree"; }; + visuals.fidget-nvim.setupOpts.notification.window.avoid = ["NvimTree"]; + lazy.plugins.nvim-tree-lua = { package = "nvim-tree-lua"; setupModule = "nvim-tree"; diff --git a/modules/plugins/visuals/fidget-nvim/fidget.nix b/modules/plugins/visuals/fidget-nvim/fidget.nix index f5bdf397..c87c20ce 100644 --- a/modules/plugins/visuals/fidget-nvim/fidget.nix +++ b/modules/plugins/visuals/fidget-nvim/fidget.nix @@ -53,6 +53,24 @@ in { end ''; }; + clear_on_detach = mkOption { + type = nullOr luaInline; + default = mkLuaInline '' + function(client_id) + local client = vim.lsp.get_client_by_id(client_id) + return client and client.name or nil + end + ''; + defaultText = literalExpression '' + default = mkLuaInline ''' + function(client_id) + local client = vim.lsp.get_client_by_id(client_id) + return client and client.name or nil + end + '''; + ''; + description = "Clear notification group when LSP server detaches"; + }; ignore = mkOption { description = "Ignore LSP servers by name"; type = listOf str; @@ -417,6 +435,20 @@ in { type = bool; default = true; }; + align = mkOption { + type = enum ["message" "annote"]; + default = "message"; + description = "Indent messages longer than a single line"; + }; + reflow = mkOption { + type = enum ["hard" "hyphenate" "ellipsis" "false"]; + default = "false"; + description = '' + Reflow (wrap) messages wider than notification window + + The various options determine how wrapping is handled mid-word. + ''; + }; icon_separator = mkOption { description = "Separator between group name and icon"; type = str; @@ -432,6 +464,16 @@ in { type = str; default = "Comment"; }; + line_margin = mkOption { + type = int; + default = 1; + description = '' + Spaces to pad both sides of each non-empty line + + Useful for adding a visual gap between notification text + and any buffer it may overlap with. + ''; + }; render_message = mkOption { description = "How to render notification messages"; type = luaInline; @@ -462,6 +504,15 @@ in { then config.vim.ui.borders.globalStyle else "none"; }; + border_hl = mkOption { + type = str; + default = ""; + description = '' + Highlight group for notification window border + + Set to empty string to keep your theme's default `FloatBorder` highlight. + ''; + }; zindex = mkOption { description = "Stacking priority of the notification window"; type = int; @@ -497,25 +548,15 @@ in { type = enum ["editor" "win"]; default = "editor"; }; - }; - }; - - integration = { - nvim-tree = { - enable = mkOption { - description = "Integrate with nvim-tree/nvim-tree.lua (if enabled)"; - type = bool; - default = - if config.vim.filetree.nvimTree.enable - then true - else false; + tabstop = mkOption { + type = int; + default = 8; + description = "Width of each tab character in the notification window"; }; - }; - xcodebuild-nvim = { - enable = mkOption { - description = "Integrate with wojciech-kulik/xcodebuild.nvim (if enabled)"; - type = bool; - default = true; + avoid = mkOption { + type = listOf str; + default = []; + description = "Filetypes the notification window should avoid"; }; }; }; @@ -545,6 +586,46 @@ in { ''; }; }; + + # removed, see below + integration = { + nvim-tree.enable = mkOption { + default = null; + visible = false; + }; + xcodebuild-nvim.enable = mkOption { + default = null; + visible = false; + }; + }; }; }; + + # this can't be done better, I tried + # mostly mostly caused by the deprecated options being inside a submodule + # try improving this if you don't care about your sanity + # ~ poz + config = { + assertions = let + inherit (config.vim.visuals.fidget-nvim.setupOpts) integration; + in [ + { + assertion = integration.nvim-tree.enable == null; + message = '' + Option `vim.visuals.fidget-nvim.setupOpts.integration.nvim-tree.enable` + has been deprecated upstream. Use + `vim.visuals.fidget-nvim.setupOpts.notification.window.avoid = ["NvimTree"]` instead. + This is already set if `vim.filetree.nvimTree.enable == true`. + ''; + } + { + assertion = integration.xcodebuild-nvim.enable == null; + message = '' + Option `vim.visuals.fidget-nvim.setupOpts.integration.xcodebuild-nvim.enable` + has been deprecated upstream. Use + `vim.visuals.fidget-nvim.setupOpts.notification.window.avoid = ["TestExplorer"]` instead. + ''; + } + ]; + }; }