From 2656538a84b7c7423a327ca55b200a064b8bb73e Mon Sep 17 00:00:00 2001 From: Snoweuph Date: Fri, 10 Apr 2026 21:32:29 +0200 Subject: [PATCH] treesitter: allow null in grammar options --- docs/manual/release-notes/rl-0.9.md | 3 +++ modules/plugins/treesitter/treesitter.nix | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/docs/manual/release-notes/rl-0.9.md b/docs/manual/release-notes/rl-0.9.md index 3e09d256..a6e5dfd6 100644 --- a/docs/manual/release-notes/rl-0.9.md +++ b/docs/manual/release-notes/rl-0.9.md @@ -229,6 +229,9 @@ [Snoweuph](https://github.com/snoweuph) +- Fix `tressiter` to allow `null` in grammar options, so they can be filtered + out. + - Added [Selenen](https://github.com/kampfkarren/selene) for more diagnostics in `languages.lua`. diff --git a/modules/plugins/treesitter/treesitter.nix b/modules/plugins/treesitter/treesitter.nix index c2039a9f..a25c1d3f 100644 --- a/modules/plugins/treesitter/treesitter.nix +++ b/modules/plugins/treesitter/treesitter.nix @@ -4,7 +4,7 @@ ... }: let inherit (lib.options) mkOption mkEnableOption literalExpression; - inherit (lib.types) listOf package bool; + inherit (lib.types) listOf nullOr package bool; in { options.vim.treesitter = { enable = mkEnableOption "treesitter, also enabled automatically through language options"; @@ -13,7 +13,7 @@ in { autotagHtml = mkEnableOption "autoclose and rename html tag"; grammars = mkOption { - type = listOf package; + type = listOf (nullOr package); default = []; example = literalExpression '' with pkgs.vimPlugins.nvim-treesitter.grammarPlugins; [