plugins/otter: consider both the new and the old treesitter api

This commit is contained in:
wadsaek 2025-12-24 19:47:44 +02:00 committed by Austin Horstman
parent 1787eeda5a
commit 77a302b98f

View file

@ -83,11 +83,15 @@ lib.nixvim.plugins.mkNeovimPlugin {
extraConfig = cfg: { extraConfig = cfg: {
warnings = lib.nixvim.mkWarnings "plugins.otter" { warnings = lib.nixvim.mkWarnings "plugins.otter" {
when = when =
config.plugins.treesitter.enable -> config.plugins.treesitter.settings.highlight.enable == null; let
inherit (config.plugins) treesitter;
highlightEnabled = treesitter.highlight.enable || (treesitter.settings.highlight.enable or false);
in
config.plugins.treesitter.enable -> highlightEnabled == null;
message = '' message = ''
You have enabled otter, but treesitter syntax highlighting is not enabled. You have enabled otter, but treesitter syntax highlighting is not enabled.
Otter functionality might not work as expected without it. Make sure `plugins.treesitter.settings.highlight.enable` and `plugins.treesitter.enable` are enabled. Otter functionality might not work as expected without it. Make sure `plugins.treesitter.highlight.enable` and `plugins.treesitter.enable` are enabled.
''; '';
}; };