Skip to content

Commit c7b109f

Browse files
committed
plugins/otter: fix treesitter warning
1 parent 2206328 commit c7b109f

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

plugins/by-name/otter/default.nix

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,10 +101,12 @@ helpers.neovim-plugin.mkNeovimPlugin {
101101

102102
extraConfig = cfg: {
103103
warnings =
104-
lib.optional (cfg.enable && config.plugins.treesitter.settings.highlight.enable == null)
104+
lib.optional
105+
(config.plugins.treesitter.enable -> config.plugins.treesitter.settings.highlight.enable == null)
106+
105107
''
106-
NixVim(plugins.otter): you have enabled otter, but `plugins.treesitter.settings.highlight.enable` is not enabled.
107-
Otter functionality might not work as expected without it and `plugins.treesitter.enable` enabled.
108+
NixVim(plugins.otter): you have enabled otter, but treesitter syntax highlighting is not enabled.
109+
Otter functionality might not work as expected without it. Make sure `plugins.treesitter.settings.highlight.enable` and `plugins.treesitter.enable` are enabled.
108110
'';
109111

110112
plugins.lsp.onAttach = lib.mkIf cfg.autoActivate ''

tests/test-sources/plugins/by-name/otter/default.nix

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,20 @@
33
plugins = {
44
otter.enable = true;
55
# Avoid the warning
6-
treesitter.settings.highlight.enable = true;
6+
treesitter = {
7+
enable = true;
8+
settings.highlight.enable = true;
9+
};
710
};
811
};
912

1013
defaults = {
1114
plugins = {
1215
# Avoid the warning
13-
treesitter.settings.highlight.enable = true;
16+
treesitter = {
17+
enable = true;
18+
settings.highlight.enable = true;
19+
};
1420

1521
otter = {
1622
enable = true;

0 commit comments

Comments
 (0)