From 88d5a499d06eaf0602f72eec83214826f131bcbc Mon Sep 17 00:00:00 2001 From: alfarel Date: Fri, 28 Mar 2025 11:04:20 -0400 Subject: [PATCH 1/2] fix(formatter/conform-nvim): allow disabling format on/after save --- docs/release-notes/rl-0.8.md | 5 ++++- modules/plugins/formatter/conform-nvim/conform-nvim.nix | 6 +++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/docs/release-notes/rl-0.8.md b/docs/release-notes/rl-0.8.md index fe3e3166..5d0e1dbe 100644 --- a/docs/release-notes/rl-0.8.md +++ b/docs/release-notes/rl-0.8.md @@ -235,8 +235,9 @@ [alfarel](https://github.com/alfarelcynthesis): -- Add missing `yazi.nvim` dependency (`snacks.nvim`). +[conform.nvim]: https://github.com/stevearc/conform.nvim +- Add missing `yazi.nvim` dependency (`snacks.nvim`). - Add [mkdir.nvim](https://github.com/jghauser/mkdir.nvim) plugin for automatic creation of parent directories when editing a nested file. - Add [nix-develop.nvim](https://github.com/figsoda/nix-develop.nvim) plugin for @@ -248,6 +249,8 @@ [friendly-snippets](https://github.com/rafamadriz/friendly-snippets) so blink.cmp can source snippets from it. - Fix [blink.cmp] breaking when built-in sources were modified. +- Fix [conform.nvim] not allowing disabling formatting on and after save. + Use `null` value to disable them if conform is enabled. [TheColorman](https://github.com/TheColorman): diff --git a/modules/plugins/formatter/conform-nvim/conform-nvim.nix b/modules/plugins/formatter/conform-nvim/conform-nvim.nix index 423a4f44..727985a3 100644 --- a/modules/plugins/formatter/conform-nvim/conform-nvim.nix +++ b/modules/plugins/formatter/conform-nvim/conform-nvim.nix @@ -4,7 +4,7 @@ ... }: let inherit (lib.options) mkOption mkEnableOption literalExpression; - inherit (lib.types) attrs enum; + inherit (lib.types) attrs enum nullOr; inherit (lib.nvim.types) mkPluginSetupOption; inherit (lib.nvim.lua) mkLuaInline; in { @@ -31,7 +31,7 @@ in { }; format_on_save = mkOption { - type = attrs; + type = nullOr attrs; default = { lsp_format = "fallback"; timeout_ms = 500; @@ -43,7 +43,7 @@ in { }; format_after_save = mkOption { - type = attrs; + type = nullOr attrs; default = {lsp_format = "fallback";}; description = '' Table that will be passed to `conform.format()`. If this From d33286d5495a4b0869e8cb8e25fc8e0778060eb8 Mon Sep 17 00:00:00 2001 From: NotAShelf Date: Mon, 31 Mar 2025 03:22:25 +0300 Subject: [PATCH 2/2] diagnostics/nvim-lint: enable autocmd only if nvim-lint is enabled --- modules/plugins/diagnostics/nvim-lint/config.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/plugins/diagnostics/nvim-lint/config.nix b/modules/plugins/diagnostics/nvim-lint/config.nix index cf9c45e2..b284270b 100644 --- a/modules/plugins/diagnostics/nvim-lint/config.nix +++ b/modules/plugins/diagnostics/nvim-lint/config.nix @@ -31,7 +31,7 @@ in { ''; }; }) - (mkIf cfg.lint_after_save { + (mkIf (cfg.enable && cfg.lint_after_save) { vim = { augroups = [{name = "nvf_nvim_lint";}]; autocmds = [