This is a bug from the original repository https://github.com/p00f/nvim-ts-rainbow/issues/112
This bug happens whenever a buffer is reloaded and it's content changes, this could happen by using a formatter, using git to checkout an open file, or any other actions that modifies an open file from outside of Neovim.
I have submitted 2 fixes for the issue https://github.com/mrjones2014/nvim-ts-rainbow/pull/8https://github.com/nvim-treesitter/nvim-treesitter/issues/4187
Essentially, when the rainbow plugin reloads, it seems that the tree has not been reparsed, and so the function full update uses the previous tree to create the highlights.
The changes to treesitter are needed because the detach function is only called after the first reload. So if a buffer is reloaded more than once then there still may be invalid highlights.
For simplicity, if you want to check my branch without checking out a different treesitter branch you can add
This is a bug from the original repository https://github.com/p00f/nvim-ts-rainbow/issues/112 This bug happens whenever a buffer is reloaded and it's content changes, this could happen by using a formatter, using git to checkout an open file, or any other actions that modifies an open file from outside of Neovim.
I have submitted 2 fixes for the issue https://github.com/mrjones2014/nvim-ts-rainbow/pull/8 https://github.com/nvim-treesitter/nvim-treesitter/issues/4187 Essentially, when the rainbow plugin reloads, it seems that the tree has not been reparsed, and so the function full update uses the previous tree to create the highlights. The changes to treesitter are needed because the detach function is only called after the first reload. So if a buffer is reloaded more than once then there still may be invalid highlights.
For simplicity, if you want to check my branch without checking out a different treesitter branch you can add
to the start of the M.attach function.