cmp: skip trigger_load if lazy disabled

This commit is contained in:
Ching Pei Yang 2024-11-03 19:00:25 +01:00
parent 850465faba
commit d3ff60bd4c
No known key found for this signature in database
GPG key ID: B3841364253DC4C8

View file

@ -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"];