From d3ff60bd4c675d79232e1bb8369ae2c7610f775f Mon Sep 17 00:00:00 2001 From: Ching Pei Yang Date: Sun, 3 Nov 2024 19:00:25 +0100 Subject: [PATCH] cmp: skip trigger_load if lazy disabled --- modules/plugins/completion/nvim-cmp/config.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/plugins/completion/nvim-cmp/config.nix b/modules/plugins/completion/nvim-cmp/config.nix index 4d4c257..54670ac 100644 --- a/modules/plugins/completion/nvim-cmp/config.nix +++ b/modules/plugins/completion/nvim-cmp/config.nix @@ -41,13 +41,13 @@ in { package = "nvim-cmp"; after = '' ${optionalString luasnipEnable "local luasnip = require('luasnip')"} - require("lz.n").trigger_load("cmp-path") local cmp = require("cmp") cmp.setup(${toLuaObject cfg.setupOpts}) - ${concatStringsSep "\n" (map - (package: "require('lz.n').trigger_load(${toLuaObject (getPluginName package)})") - cfg.sourcePlugins)} + ${optionalString config.vim.lazy.enable + (concatStringsSep "\n" (map + (package: "require('lz.n').trigger_load(${toLuaObject (getPluginName package)})") + cfg.sourcePlugins))} ''; event = ["InsertEnter" "CmdlineEnter"];