OXY2DEV / markview.nvim

An experimental markdown previewer for Neovim
Apache License 2.0
1.24k stars 35 forks source link

Error detected while processing BufWinEnter #48

Closed Tainted-Fool closed 2 months ago

Tainted-Fool commented 2 months ago

Nvim v0.11.0-dev-381+gfb6c059dc

Getting these errors when using this plugin. The plugin is working but errors appears:

Error detected while processing BufWinEnter Autocommands for "": Error executing lua callback: .../share/nvim/lazy/markview.nvim/lua/markview/renderer.lua:969: Invalid 'end_col': out of range stack traceback: [C]: in function 'nvim_buf_set_extmark' .../share/nvim/lazy/markview.nvim/lua/markview/renderer.lua:969: in function 'render_hyperlinks' .../share/nvim/lazy/markview.nvim/lua/markview/renderer.lua:1195: in function 'render' ...ocal/share/nvim/lazy/markview.nvim/ftplugin/markdown.lua:54: in function <...ocal/share/nvim/lazy/markview.nvim/ftplugin/markdown.lua:30>

Error detected while processing ModeChanged Autocommands for "": Error executing lua callback: .../share/nvim/lazy/markview.nvim/lua/markview/renderer.lua:969: Invalid 'end_col': out of range stack traceback: [C]: in function 'nvim_buf_set_extmark' .../share/nvim/lazy/markview.nvim/lua/markview/renderer.lua:969: in function 'render_hyperlinks' .../share/nvim/lazy/markview.nvim/lua/markview/renderer.lua:1195: in function 'render' ...ocal/share/nvim/lazy/markview.nvim/ftplugin/markdown.lua:78: in function <...ocal/share/nvim/lazy/markview.nvim/ftplugin/markdown.lua:63>

My config is as followed: image

OXY2DEV commented 2 months ago

There's most likely something wrong with the links in whatever file you opened.

Does it happen to all of the markdown files? Or just a specific file?

If it only happens in a specific file. I suggest you look at all the links in that file and see if any of them seem off(stuff like emojis/multi-width characters in links, malformed links, e.g. links that aren't made of []() or has parts missing in link etc.)

Tainted-Fool commented 2 months ago

@OXY2DEV That was it. There was a \n inside the brackets [] part of my readme.md file. So I had something like this: [my\n text](link). After removing the new line character, the error was gone.

Thanks! Loving the plugin 😁