-
Notifications
You must be signed in to change notification settings - Fork 52
bug: Mark updates take too long #115
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
This is a side effect of what a debounce means and differences in user behavior will make the lag better or worse. A debounce means run this function if at least So a debounce of 100 milliseconds will update the marks in the view port and any events that occurs faster than 100 milliseconds get ignored. Moving down by holding I think I can do something to improve this by treating movements differently from text changes, and skip the debounce if we don't need to parse the document. |
…ange # Details Issue: #115 After the change to parse only the visible range of a file along with a debounce there was a performance degredation for simple cursor movements. This is because cursor movements no longer had the benefit of using cached marks, so are re-computed and feed into the same debounced method. This can cause laggy behavior. To fix this I have added back the caching behavior from before with some updates to account for the new logic. Like before marks will not be parsed for events that do not update the text. In addition to the simple event check we also need to validate that the range of cached marks accounts for everything in the users viewport, otherwise we still need to parse. This should have the benefits of the snappy behavior from before along with being able to handle essentially arbitrary file sizes. Have increased the default max file size to 10MB since performance impact is minimal.
I've pushed a change to avoid debounce / parsing on cursor movements, should improve the lag: 6bb1d43. LMK if it works better after the update! |
Wow, fastest developer on Github! Everything works great. Now I can happily continue spamming |
Neovim version (nvim -v)
0.10.1
Operating system
Arch Linux
Terminal emulator / GUI
Alacritty
Describe the bug
There is a noticeable delay between moving the cursor off a line and the marks on that line being updated. This can be solved by setting
debounce = 0
, but should not be necessary given that the default is only 100 milliseconds.recording.mp4
Expected behavior
The marks on a line update near instantly when the cursor is move elsewhere.
Healthcheck output
Plugin configuration
Confirmations
Additional information
Markdown text used in recording.
The text was updated successfully, but these errors were encountered: