HiPhish / rainbow-delimiters.nvim

Rainbow delimiters for Neovim with Tree-sitter
https://gitlab.com/HiPhish/rainbow-delimiters.nvim
Apache License 2.0
465 stars 34 forks source link

[Bug]: Error when calling vim.lsp.buf.hover #119

Closed halloween-jack closed 1 month ago

halloween-jack commented 1 month ago

Neovim version

NVIM v0.11.0-dev-99+g05a65432b6

Language affected

No response

Query

No response

Strategy

No response

Description

Error in decoration provider treesitter/highlighter.win:
Error executing lua: Vim:E475: Invalid value for argument type: c
stack traceback:
        [C]: in function 'getregionpos'
        /usr/share/nvim/runtime/lua/vim/highlight.lua:72: in function 'range'
        ...y/rainbow-delimiters.nvim/lua/rainbow-delimiters/lib.lua:111: in function 'highlight'
        ...limiters.nvim/lua/rainbow-delimiters/strategy/global.lua:51: in function 'highlight_matches'
        ...limiters.nvim/lua/rainbow-delimiters/strategy/global.lua:163: in function 'update_range'
        ...limiters.nvim/lua/rainbow-delimiters/strategy/global.lua:238: in function 'cb'
        /usr/share/nvim/runtime/lua/vim/treesitter/languagetree.lua:881: in function '_do_callback'
        /usr/share/nvim/runtime/lua/vim/treesitter/languagetree.lua:366: in function '_parse_regions'
        /usr/share/nvim/runtime/lua/vim/treesitter/languagetree.lua:439: in function 'parse'
        /usr/share/nvim/runtime/lua/vim/treesitter/languagetree.lua:460: in function 'parse'
        /usr/share/nvim/runtime/lua/vim/treesitter/highlighter.l
Press ENTER or type command to continue
halloween-jack commented 1 month ago

https://github.com/neovim/neovim/commit/bdb81afab3e5c43a33267666c2689feb284f6b52 I guess this is because getregionpos() is now used instead of region() in this commit.

Danielkonge commented 1 month ago

I haven't looked much at the code recently, but this seems to be caused by regtype = 'c' on line 102 in lua/rainbow-delimiters/lib.lua. Changing it to regtype = 'v' seemed to fix the problems I had with it. (I included this change in the pull request I made just now.)

HiPhish commented 1 month ago

@halloween-jack Can you try the current master please?

ilias777 commented 1 month ago

I have no more this error message after the commit b10fba4. 👍🏻

halloween-jack commented 1 month ago

@HiPhish I think it is fixed. Thanks for responding.