treesitter: allow null in grammar options

This commit is contained in:
Snoweuph 2026-04-10 21:32:29 +02:00
commit 2656538a84
No known key found for this signature in database
GPG key ID: BEFC41DA223CEC55
2 changed files with 5 additions and 2 deletions

View file

@ -229,6 +229,9 @@
[Snoweuph](https://github.com/snoweuph) [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 - Added [Selenen](https://github.com/kampfkarren/selene) for more diagnostics in
`languages.lua`. `languages.lua`.

View file

@ -4,7 +4,7 @@
... ...
}: let }: let
inherit (lib.options) mkOption mkEnableOption literalExpression; inherit (lib.options) mkOption mkEnableOption literalExpression;
inherit (lib.types) listOf package bool; inherit (lib.types) listOf nullOr package bool;
in { in {
options.vim.treesitter = { options.vim.treesitter = {
enable = mkEnableOption "treesitter, also enabled automatically through language options"; enable = mkEnableOption "treesitter, also enabled automatically through language options";
@ -13,7 +13,7 @@ in {
autotagHtml = mkEnableOption "autoclose and rename html tag"; autotagHtml = mkEnableOption "autoclose and rename html tag";
grammars = mkOption { grammars = mkOption {
type = listOf package; type = listOf (nullOr package);
default = []; default = [];
example = literalExpression '' example = literalExpression ''
with pkgs.vimPlugins.nvim-treesitter.grammarPlugins; [ with pkgs.vimPlugins.nvim-treesitter.grammarPlugins; [