todo-comments.nvim icon indicating copy to clipboard operation
todo-comments.nvim copied to clipboard

[BUG] Wrong highlighting when appending a comment before a todo

Open ThomasFrans opened this issue 2 years ago • 1 comments

The for in the next image shouldn't be highlighted, and it isn't when I reload the file. The reason it highlights is because I just added an extra comment above it. The todo highlight probably needs to be updated when a line is appended above or something... Wrong: image

Correct: image

ThomasFrans avatar Sep 24 '22 12:09 ThomasFrans

What I have observed is that deleting lines above the comment is not messing things up. However, if you add one or more lines above the highlighted comment, the highlight is activated on the line below a "TODO"-like comment. Inserting characters on the line with a "TODO" like comment fixes the highlight for the particular line (as does reloading of the buffer as @ThomasFrans mentioned)

I'm on neovim 0.8.0

image image image

mr-majkel avatar Oct 13 '22 10:10 mr-majkel

This also breaks the code highlighting: Screen Shot 2022-11-05 at 12 48 28

judaew avatar Nov 05 '22 10:11 judaew

This does not fix for non-treesister based highlighting.

judaew avatar Nov 07 '22 09:11 judaew

@judaew are you sure? I don't think the issue happens for non-treesitter highlighting. The issue is cause by the async nature of teesitter. We render the highlights before treesitter knows a certain node is a comment.

folke avatar Nov 07 '22 09:11 folke

I have this problem with judaew/macports.nvim which does not use treesister.

judaew avatar Nov 07 '22 09:11 judaew

Just FYI: This is now fixed.

judaew avatar Nov 16 '22 19:11 judaew