From b9a4f0ca19201cbc2e6c583f3f3a269fe1a6314f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=A9tan=20Lepage?= <33058747+GaetanLepage@users.noreply.github.com> Date: Fri, 13 Jan 2023 11:48:24 +0100 Subject: [PATCH] plugins/languages/treesitter: fixed parsers installation when not using nixGrammars (#116) --- plugins/languages/treesitter.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/languages/treesitter.nix b/plugins/languages/treesitter.nix index da46b4dd..8539af81 100644 --- a/plugins/languages/treesitter.nix +++ b/plugins/languages/treesitter.nix @@ -119,10 +119,10 @@ in } // cfg.moduleConfig; in mkIf cfg.enable { - extraConfigLua = '' - require('nvim-treesitter.configs').setup(${helpers.toLuaObject tsOptions}) - '' + optionalString (cfg.parserInstallDir != null) '' + extraConfigLua = (optionalString (cfg.parserInstallDir != null) '' vim.opt.runtimepath:append("${cfg.parserInstallDir}") + '') + '' + require('nvim-treesitter.configs').setup(${helpers.toLuaObject tsOptions}) ''; extraPlugins = with pkgs; if cfg.nixGrammars then