Skip to content

refactor(ui): restore native scrollbind - #557

Merged
esmuellert merged 1 commit into
mainfrom
refactor/restore-native-scrollbind
Sep 10, 2026
Merged

refactor(ui): restore native scrollbind#557
esmuellert merged 1 commit into
mainfrom
refactor/restore-native-scrollbind

Conversation

@esmuellert

@esmuellert esmuellert commented Sep 10, 2026

Copy link
Copy Markdown
Owner

Summary

  • Remove the custom structural scroll-sync engine and its per-tab manager.
  • Restore Neovim's native scrollbind/syncbind setup for side-by-side and conflict views.
  • Keep refresh, lifecycle, and moved-block alignment behavior working with native scrollbind.
  • Clear inherited scrollbind from Explorer and user-created split windows, and use session-owned windows during refresh.
  • Replace engine-specific specs with native scrollbind coverage, including the tall virt_lines regression case.

Why

Neovim's tall-virt_lines scrollbind regression was fixed upstream in Neovim PR #41519. The structural scroll-sync engine also introduced a second scroll path that conflicts with Snacks' smooth-scroll animation, which is the cause of #519. CodeDiff no longer needs that parallel path, so this PR restores the native mechanism and removes the conflicting WinScrolled event, virtual-row mapping, and echo-management code.

Fixes #519

Testing

  • cmake -B build -S . && cmake --build build --parallel 5
  • ./tests/run_tests.sh (109 spec files, all passed)
  • Headless scroll stress test on Neovim 0.13-dev: 500 downward and 500 upward scroll steps across large insertion, deletion, and leading-insertion diffs; maximum backward jump was 0.
  • git diff --check

@esmuellert
esmuellert requested a review from yanuoma as a code owner September 10, 2026 02:31
@esmuellert
esmuellert merged commit 63e1cbe into main Sep 10, 2026
19 of 20 checks passed
@esmuellert
esmuellert deleted the refactor/restore-native-scrollbind branch September 10, 2026 02:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Visual jitter during next/previous-hunk navigation if animations are turned on

1 participant