diff --git a/plugins/by-name/otter/default.nix b/plugins/by-name/otter/default.nix index a27f7dd0..b9a6aa9c 100644 --- a/plugins/by-name/otter/default.nix +++ b/plugins/by-name/otter/default.nix @@ -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. diff --git a/tests/test-sources/plugins/by-name/otter/default.nix b/tests/test-sources/plugins/by-name/otter/default.nix index 8ba902df..040ee57a 100644 --- a/tests/test-sources/plugins/by-name/otter/default.nix +++ b/tests/test-sources/plugins/by-name/otter/default.nix @@ -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; + }; + }; }