fix(highlight): avoid stale vim syntax redraws #211

Merged
barrettruth merged 3 commits from fix/vim-syntax-flicker into main 2026-04-06 18:23:13 +00:00
barrettruth commented 2026-04-06 18:15:39 +00:00

Summary

  • cache vim fallback syntax spans so deferred renders can reuse warm syntax immediately instead of always waiting for a scratch-buffer pass
  • track per-buffer deferred syntax jobs and changedticks so stale scheduled syntax work is skipped after buffer changes or refreshes
  • add regression coverage for cached vim syntax reuse and stale deferred syntax cancellation

Test plan

  • nix develop -c busted spec/highlight_spec.lua
  • nix develop -c busted spec/decoration_provider_spec.lua
  • nix develop -c busted
  • nix develop -c stylua --check lua/diffs/highlight.lua lua/diffs/init.lua spec/highlight_spec.lua spec/decoration_provider_spec.lua
## Summary - cache vim fallback syntax spans so deferred renders can reuse warm syntax immediately instead of always waiting for a scratch-buffer pass - track per-buffer deferred syntax jobs and changedticks so stale scheduled syntax work is skipped after buffer changes or refreshes - add regression coverage for cached vim syntax reuse and stale deferred syntax cancellation #### Test plan - [x] nix develop -c busted spec/highlight_spec.lua - [x] nix develop -c busted spec/decoration_provider_spec.lua - [x] nix develop -c busted - [x] nix develop -c stylua --check lua/diffs/highlight.lua lua/diffs/init.lua spec/highlight_spec.lua spec/decoration_provider_spec.lua
Sign in to join this conversation.
No description provided.