You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using Zotcite with Treesitter, I encountered an issue where the plugin fails to initialise properly if it's set up to load before Treesitter. Specifically, the error message "is treesitter enabled?" appears after saving a file, suggesting that Treesitter isn't fully initialised when Zotcite tries to use it.
Steps to reproduce:
Set up Zotcite with Treesitter as a dependency in lazy.nvim.
Save a file with Zotcite enabled.
The error message "is treesitter enabled?" appears.
What I tried:
After checking :checkhealth nvim-treesitter, Treesitter appears to be properly installed and up to date.
I added vim.defer_fn to delay Zotcite's setup, which resolved the issue:
Zotcite should properly initialize only after Treesitter has been fully loaded, without the need for manual delay.
Proposed solution:
It seems Zotcite tries to use Treesitter functions before Treesitter is fully initialized. I suggest adding a check to ensure that Treesitter is ready before proceeding with any Treesitter-dependent functionality, or deferring the setup until Treesitter is available.
The text was updated successfully, but these errors were encountered:
Thanks for reporting the bug! How can we know that treesitter is not ready yet? The command that uses treesitter is already scheduled to run when Neovim is idle (lua/zotcite/config.lua, line 252):
My apologies, I think the actual issue is somewhere inbetween treesitter.nvim, obsidian.nvim and zotcite.nvim
Since (independently) disabling both obsidian and zotcite stops the issue happening.
And, it only seems to happen when navigating from a file explorer within nvim as opposed to opening the file directly
I'll have a look at this and try to produce a MWE, but my nvim config is here: nvim
When using Zotcite with Treesitter, I encountered an issue where the plugin fails to initialise properly if it's set up to load before Treesitter. Specifically, the error message "is treesitter enabled?" appears after saving a file, suggesting that Treesitter isn't fully initialised when Zotcite tries to use it.
Steps to reproduce:
What I tried:
I added vim.defer_fn to delay Zotcite's setup, which resolved the issue:
Expected behavior:
Zotcite should properly initialize only after Treesitter has been fully loaded, without the need for manual delay.
Proposed solution:
It seems Zotcite tries to use Treesitter functions before Treesitter is fully initialized. I suggest adding a check to ensure that Treesitter is ready before proceeding with any Treesitter-dependent functionality, or deferring the setup until Treesitter is available.
The text was updated successfully, but these errors were encountered: