Skip to content
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

Missed cache invalidation for indent guidelines #130

Closed
jbarap opened this issue Aug 20, 2024 · 3 comments
Closed

Missed cache invalidation for indent guidelines #130

jbarap opened this issue Aug 20, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@jbarap
Copy link

jbarap commented Aug 20, 2024

Describe the bug
Great plugin! Love the good work dedicated to optimization.

Sometimes, when the contents of the buffer change outside the current viewport, the wrong indent guidelines are shown.

To Reproduce
Steps to reproduce the behavior:

  1. Open any file (using src/nvim/shada.c in the video)
  2. Scroll down to a section with indents
  3. Make a change that creates new indents and scrolls the window
  4. Scroll the window downward for a bit
  5. Press u to undo your edits in step 3
  6. Scroll back to the section that you were in during step 5, and a bit lower
  7. Observe the wrong indent guides

Expected behavior
The correct indent guides.

Screenshots

cache_fail.mp4

Additional context
This is just an example, but the situation has occurred several times during daily use. I've patched a workaround in my local version, where any time a render isn't "lazy", it invalidates the cache for the whole buffer. I haven't noticed any performance impact by doing this, but I haven't measured anything. I'd imagine you'd want to do something more clever, though.

@shellRaining
Copy link
Owner

I also frequently encounter this issue, but sorry, I've recently started an internship and found some other things that interest me, so it might be a long time before this issue gets resolved.
You can temporarily use indent_blankline as a substitute, and I will contact you once the issue is fixed.

@jbarap
Copy link
Author

jbarap commented Aug 21, 2024

No worries, I'll see if I can tinker with it when I have some free time and may submit a PR. Best of luck with your internship!

@shellRaining
Copy link
Owner

@jbarap commits on the dev branch may have fixed this issue, feel free to give it a try.

@shellRaining shellRaining added the bug Something isn't working label Aug 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants