Closed wbthomason closed 3 years ago
It's worth mentioning also that I've tested this to work with Sumneko Lua, rust-analyzer, JuliaLS, and pyright so far.
Seems perfect to me 👍🏻
@nerosnm, does this also maintain the fix to #36 for you? Since I was never able to reproduce #36, I'd like to get a couple of verifications that this still works as a fix.
@wbthomason I'll test this today and let you know
Still seems to be fine for me over the last few days
Great, thanks for testing. I think we're good to merge, then (famous last words...)
This refactor builds on @joshuachp's timer-based design to offer (hopefully) the best of performance and simplicity. It refactors the redraw logic to be triggered when requested if it's been
update_interval
ms since the last redraw. This is in contrast to the every-update_interval
ms check of the current design.While the performance of these two designs is probably similar (this is at best a micro-optimization, though it should not be slower), I think this design is a bit simpler - we don't have to track the state of the
needs_redraw
flag, we don't eagerly generate the statusline text, etc.We do still need a timer, but it runs at most once per redraw interval, and usually will not need to run. Its purpose is to account for redraws requested too close to the last redraw.
@joshuachp, what do you think? Does this branch still solve the performance issues of #36? Do you agree that this is simpler?