Open martin-braun opened 3 months ago
UPDATE:
I managed to get it to work, but there is still an issue. Apparently, after loading the plugin, I still have to leave and re-enter the buffer with the markdown to make the command available. This is obviously an issue.
So, it seems the issue is that it doesn't load something on initial load (except after being installed in the current session), but only when entering the markdown buffer.
Very good news: I found a fix!
Apparently the issue is solved if I tell Lazy.nvim to always load the plugin for "markdown" file types:
M.ft = { "markdown" }
M.cmd = nil
It seems this will cause the plugin to be load before BufEnter
or whatever the event is that gets missed using M.cmd
.
Obviously, the issue isn't solved, but this fix is good enough for me, so that I can move on.
Thanks.
Describe the bug I managed to load the plugin, but it fails to load when
nvim
is opened at any given time after the first time. Only when the plugin just got installed, it will load properly.To Reproduce I'm using NvChad which uses Lazy.nvim internally. Part of my
plugins
table is this plugin file:I require the above file and
table.insert
this intoM.plugins
in mychadrc.lua
.Expected behavior I can confirm this works just fine after adding my code.
:MarkdownPreview
opens the browser and I can see everything gets synced properly.However, if I close
nvim
and reopen it, despite the plugin being load again, it will not work anymore.The expected behavior is that this should work. If it works in the first session, it should also work in the 2nd session and so on.
Desktop (please complete the following information):
Log:
v20.14.0
Additional comments
vim.fn
build method, but this wouldn't work at all, not even at the first time, although I get no errors and everything looks alright