duplicated vimtex source problem
Thank you for your efforts,
If I configure cmp-vimex, CmpStatus shows me the vimtex sources are duplicated
In nvim-cmp lazy.nvim setup, I called the cmp-vimtex plugin as dependencies.
Case 1) If I don't configure cmp-vimtex
dependencies = {
'hrsh7th/cmp-buffer', -- source for text in buffer
'hrsh7th/cmp-path', -- source for file system path
'hrsh7th/cmp-cmdline', -- source for commandline, [command], [path]
'hrsh7th/cmp-nvim-lsp', -- using LSP for source
'f3fora/cmp-spell', -- source for vim's spellsuggest
'L3MON4D3/LuaSnip', -- snippet engine
'saadparwaiz1/cmp_luasnip', -- using LuaSnip for source
'mstanciu552/cmp-matlab', -- source of matlab
{
'micangl/cmp-vimtex', -- source of vimtex for latex
},
},
Cmp-vimtex loaded just once for unused source names (I didn't load this source to confirm how many this source is called just.)
Case 2) If I configure cmp-vimtex
dependencies = {
'hrsh7th/cmp-buffer', -- source for text in buffer
'hrsh7th/cmp-path', -- source for file system path
'hrsh7th/cmp-cmdline', -- source for commandline, [command], [path]
'hrsh7th/cmp-nvim-lsp', -- using LSP for source
'f3fora/cmp-spell', -- source for vim's spellsuggest
'L3MON4D3/LuaSnip', -- snippet engine
'saadparwaiz1/cmp_luasnip', -- using LuaSnip for source
'mstanciu552/cmp-matlab', -- source of matlab
{
'micangl/cmp-vimtex', -- source of vimtex for latex
config = function ()
require('cmp_vimtex').setup({})
end
},
},
Cmp-vimtex loaded twice as below
Could you know where the vimtex source are called one more?
Thanks for raising the issue! May I ask @benbrastmckie if he is seeing the same output (vimtex listed twice in CmpStatus), as I see that he has a similar configuration?
It shouldn't, in any case, interfere with anything.
@micangl Sure, Of course. I checked the config repository of @benbrastmckie. He configured the cmp-vimtex like this,
- configure
cmp-vimtexin a filevimtex-cmp.luaseparately and uselazy=falseloading - use
cmp-vimtexas dependencies ofnvim-cmpwithout any configuration
I applied above configuraiton before and It worked fine because it only loads once and configuration can be applied.
But The downside is that it makes nvim loading time longer than before because cmp-vimtex is loaded at startup always with long load time (~200ms)
I want to lazy-load cmp-vimtex when nvim-cmp is loaded.
But If he set lazy true in vimtex-cmp.lua, the vimtex will be called twice as the same with what I said
@Jaehaks Unfortunately, there doesn't seem to be a way with lazy to call the setup function before the after/plugin/ files are sourced. This is what happens with the "normal" plugin loading process, and is necessary to keep the source compatible with non-lazy loaders.
At the moment I'm completely swamped so, since this is not a bug which prevents the plugin from working, I'll have to postpone finding a fix, as there doesn't seem to be an immediate one.
As I said in the last comment, there doesn't seem to be a fix for this. Unfortunately, the loading processes of the various plugin managers are too different for me to provide a solution. I hope it won't be too annoying, sorry.