HiPhish / rainbow-delimiters.nvim

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

Bug fix - fixes #59 #61

Closed Danielkonge closed 7 months ago

Danielkonge commented 7 months ago

The previous fix for #59 fixed the first error, but there was another problem. I tracked down the following error to two things:

  1. vim.inspect has a problem that causes an error on vim.inspect(tree:root():range()). Using a table instead fixes this error, i.e., vim.inspect( {tree:root():range()} ).
  2. The local strategy's on_attach had a typo, where we accidentally reset a table that we wanted to keep if it exists.

This code should fix both of those problems.

Additionally I added a #define statement to the test file for c, since that was what caused this problem to show up (because it creates another tree in the same language in 0.9.4).

HiPhish commented 7 months ago

Merged, thank you.