plugins/treesitter-context: add missing warning when treesitter is not enabled

This commit is contained in:
Gaetan Lepage 2023-06-01 10:31:23 +02:00 committed by Gaétan Lepage
parent cf6a614e8b
commit 535fc7d5d3
2 changed files with 5 additions and 1 deletions

View file

@ -49,6 +49,10 @@ in {
cfg = config.plugins.treesitter-context; cfg = config.plugins.treesitter-context;
in in
mkIf cfg.enable { mkIf cfg.enable {
warnings = mkIf (!config.plugins.treesitter.enable) [
"Nixvim: treesitter-context needs treesitter to function as intended"
];
extraPlugins = [cfg.package]; extraPlugins = [cfg.package];
plugins.treesitter.moduleConfig.context = { plugins.treesitter.moduleConfig.context = {

View file

@ -174,7 +174,7 @@ in {
''; '';
}; };
extraPlugins = with pkgs; extraPlugins =
if cfg.nixGrammars if cfg.nixGrammars
then [(cfg.package.withPlugins (_: cfg.grammarPackages))] then [(cfg.package.withPlugins (_: cfg.grammarPackages))]
else [cfg.package]; else [cfg.package];