OXY2DEV / markview.nvim

An experimental markdown previewer for Neovim
Apache License 2.0
601 stars 23 forks source link

Remove hard dependency on nvim-treesitter plugin #23

Closed simifalaye closed 5 days ago

simifalaye commented 5 days ago

Markview has a hard dependency on the nvim-treesitter plugin (ie. the plugin won't load without it). This is unnecessary because the true dependency is on the markdown and markdown_inline treesitter parsers, not on the nvim-treesitter plugin itself. The check should be changed to use the vim.treesitter functions instead to check for dependencies and not on the nvim-treesitter plugin. This allows for the use of other treesitter parser installers such as that found on rocks.nvim.

NOTE: nvim-treesitter is actually moving away from having plugins depend on it for configuration and just being purely for installing and maintaining parsers/queries (See: https://github.com/nvim-treesitter/nvim-treesitter/issues/4767)

simifalaye commented 5 days ago

Ping @OXY2DEV

OXY2DEV commented 5 days ago

The reason it's there is because someone posted a PR complaining about not adding it as a dependency.

I also found that for some reason some people lazy load nvim-treesitter and since it by default stores the parsers in it's plugin directory they don't load unless you load the plugin.

I will of course remove it if it is possible. But people tend to incorrectly lazy load plugins which could be a problem.

simifalaye commented 5 days ago

We could then slightly modify the if statements then to something like: "If nvim-treesitter is not installed AND there are no parsers loaded then quit". How does that sound?

I would love to use this plugin, but it won't load because I'm not using nvim-treesitter

OXY2DEV commented 5 days ago

Yes, I will do that.