1
0
Fork 0
mirror of https://github.com/nix-community/nixvim.git synced 2025-12-25 02:10:58 +01:00

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: {
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.
'';
};