From 77a302b98f9603b60e05661cbb9991f6b8d00a7b Mon Sep 17 00:00:00 2001 From: wadsaek Date: Wed, 24 Dec 2025 19:47:44 +0200 Subject: [PATCH] plugins/otter: consider both the new and the old treesitter api --- plugins/by-name/otter/default.nix | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/plugins/by-name/otter/default.nix b/plugins/by-name/otter/default.nix index d459c78b..a27f7dd0 100644 --- a/plugins/by-name/otter/default.nix +++ b/plugins/by-name/otter/default.nix @@ -83,11 +83,15 @@ lib.nixvim.plugins.mkNeovimPlugin { extraConfig = cfg: { warnings = lib.nixvim.mkWarnings "plugins.otter" { 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 = '' 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. ''; };