jghauser / follow-md-links.nvim

Easily follow markdown links with this neovim plugin
GNU General Public License v3.0
143 stars 16 forks source link

Added method to check if we can follow link #22

Closed dogezen closed 1 month ago

dogezen commented 8 months ago

Hello, I was getting several errors / crashes with the script when pressing <cr> in text-based buffers (like a .txt or .tex buffer). So I thought of adding a check to confirm that the current buffer is of type markdown when follow_link is called in order to avoid calling it for non-markdown buffers.

I am an absolute beginner with lua plugins and especially for neovim, so if this is redundant do let me know

jghauser commented 8 months ago

Hey! Thanks for the contribution! This fix shouldn't be necessary as the plugin only sets a keymap for the markdown filetype.

https://github.com/jghauser/follow-md-links.nvim/blob/cf081a0a8e93dd188241a570b9a700b6a546ad1c/ftplugin/markdown.lua#L5-L8

So if you're seeing problems in other filetypes, something unexpected seems to be happening. Can you copy over the errors you're getting? Thanks!