echasnovski / mini.nvim

Library of 40+ independent Lua modules improving overall Neovim (version 0.8 and higher) experience with minimal effort
MIT License
4.84k stars 183 forks source link

Error executing lua when using bracketed's treesitter jumps #1142

Closed nogweii closed 1 month ago

nogweii commented 1 month ago

Contributing guidelines

Module(s)

mini.bracketed

Description

When in a Markdown file, pressing ]t (or it's reverse) enough times, usually at the end of a line, will result in the mentioned error message. In other files, the same actions produce the error message Cursor position outside buffer, from the same line.

Neovim version

0.10.1

Steps to reproduce

I thought this was maybe related to the conceal feature but turning that off doesn't change the error. I'm not sure what the minimal reproducible example is. 😓

Expected behavior

No response

Actual behavior

Stack trace:

E5108: Error executing lua .../.local/share/nvim/lazy/mini.nvim/lua/mini/bracketed.lua:928: Column value outside range

stack traceback:
        [C]: in function 'nvim_win_set_cursor'
        .../.local/share/nvim/lazy/mini.nvim/lua/mini/bracketed.lua:928: in function 'treesitter'
        [string ":lua"]:1: in main chunk
echasnovski commented 1 month ago

Thanks for the issue!

I can reproduce. The problem is indeed that treesitter returns some strange column. I'll take a look.

echasnovski commented 1 month ago

This should now be fixed on latest main.