the-mikedavis / tree-sitter-diff

A tree-sitter grammar for `diff` output
https://the-mikedavis.github.io/tree-sitter-diff/
MIT License
37 stars 11 forks source link

Neovim diff not highlighting properly #10

Closed ikirudennis closed 5 months ago

ikirudennis commented 5 months ago

Firstly, I'm not sure if this is the right place to report this...

Like some other users, I ran into an issue with neovim not highlighting diffs in gitcommit correctly. In the process of trying to solve that problem for myself, I created a diff file, and noticed that when I opened that with neovim, I also experience the same lack of highlighting. I'm able to get the highlighting issuing a command to toggle the treesitter highlighting.

Given that it's happening in both gitcommit filetypes and diff filetypes, that's how I ended up thinking that maybe this repo is the correct place to file this issue. If I'm wrong on that assumption though, can you guide me to where this issue should be filed?

Thanks!

the-mikedavis commented 5 months ago

I don't use neovim so I probably won't be of much help here. You might have better luck posting in the nvim-treesitter repository. I last updated the grammar and regenerated the bindings two weeks ago in https://github.com/the-mikedavis/tree-sitter-diff/commit/886bb5122a8e9a3b759efe24fa208856f75eceaa (and the child commit) but I don't know how that could make the nvim highlighting fail - the node I removed isn't used by nvim-treesitter's highlight queries: https://github.com/nvim-treesitter/nvim-treesitter/blob/master/queries/diff/highlights.scm. I tried updating to the latest revision in Helix as well and I don't see any breakages for the highlights

ikirudennis commented 5 months ago

Thanks for the info, I'll start barking up that tree... sitter :zany_face:

ikirudennis commented 5 months ago

Good news: upon digging into it a little more, it looks like this is a breaking change introduced into how highlighting works in neovim, and that some colorschemes have updated to reflect these changes, while others have not yet. So, everything is working as intended, and I need to file an issue with the colorscheme I use.

Thanks, again!