plugins/otter: fix highlighting warning
`highlightEnabled` can never be null, since it is the `||` of two booleans. Historically, `plugins.treesitter.settings.highlight.enable` was a default-null option. Checking for null was effectively checking for the default value. This would now be `plugins.treesitter.settings ? highlight.enable`, however reading the actual boolean more closely matches the intent.
This commit is contained in:
parent
56f03c4313
commit
4a6d561362
2 changed files with 25 additions and 1 deletions
|
|
@ -87,7 +87,7 @@ lib.nixvim.plugins.mkNeovimPlugin {
|
|||
inherit (config.plugins) treesitter;
|
||||
highlightEnabled = treesitter.highlight.enable || (treesitter.settings.highlight.enable or false);
|
||||
in
|
||||
config.plugins.treesitter.enable -> highlightEnabled == null;
|
||||
!(treesitter.enable && highlightEnabled);
|
||||
|
||||
message = ''
|
||||
You have enabled otter, but treesitter syntax highlighting is not enabled.
|
||||
|
|
|
|||
|
|
@ -61,4 +61,28 @@
|
|||
};
|
||||
};
|
||||
};
|
||||
|
||||
warning-no-highlight = {
|
||||
test.runNvim = false;
|
||||
test.warnings = expect: [
|
||||
(expect "count" 1)
|
||||
(expect "any" "You have enabled otter, but treesitter syntax highlighting is not enabled.")
|
||||
];
|
||||
plugins = {
|
||||
otter.enable = true;
|
||||
treesitter.enable = true;
|
||||
};
|
||||
};
|
||||
|
||||
warning-no-treesitter = {
|
||||
test.runNvim = false;
|
||||
test.warnings = expect: [
|
||||
(expect "count" 1)
|
||||
(expect "any" "You have enabled otter, but treesitter syntax highlighting is not enabled.")
|
||||
];
|
||||
plugins = {
|
||||
otter.enable = true;
|
||||
treesitter.highlight.enable = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue