[Fix]: Don't mark all lines in buffer as dirty, only visible lines #155
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In the original code all of the lines in the current buffer are marked as dirty. I don't know whether filetypes which have treesitter support suffer from this too but for a big buffer and a filetype such as xml this gets very slow to the point where it blocks neovim for a while until it's done. This happens too after the latest performance commits but I don't know if they were relevant.
This pr is a simple change which makes it so that only the currently visible lines in the buffer are redrawn. I'm opening this pr as a draft because I'm only using a very limited subset of this plugin's features so I don't know if anything besides simply highlighting is impacted by this. Consider it a issue report with an included preliminary fix.
If you're interested I've got a stack trace too, although the only thing it really shows is
todo-comments.highlight.match
being called 45000 times for every line of my large xml document.Other than that, hartstikke bedankt for all the fantastic work Folke! Greetings from up north :)