There is an issue with scroll behavior in your implementation.
If you quickly scroll a long text with the mouse wheel, it awkwardly glitches with a setback jittering. Tried both chrome and ff.
I investigated this and prepared a patch for the scroll jitter.
Repro steps
- Open AceDiff with long content on both sides.
- Enable scroll sync (
lockScrolling: true).
- Quickly scroll with mouse wheel in either pane.
- Observe occasional backward/setback jumps (jitter).
Expected
Smooth synchronized scrolling without rollback/jumps.
Actual
When scrolling fast, panes sometimes "fight" each other and produce setback jitter.
Suspected cause
Both panes have independent throttled changeScrollTop handlers.
Under fast wheel input, delayed/throttled callbacks can execute out of order and compete.
Proposed fix
Use one centralized scroll scheduler:
- keep
lastScrollSource
- cancel pending frame
- sync once per
requestAnimationFrame
This removes throttle competition between left/right handlers.
I attached a patch file:
issue-140-scroll-jitter.patch
(contains changes in src/index.ts)
issue-140-scroll-jitter.patch
There is an issue with scroll behavior in your implementation.
If you quickly scroll a long text with the mouse wheel, it awkwardly glitches with a setback jittering. Tried both chrome and ff.
I investigated this and prepared a patch for the scroll jitter.
Repro steps
lockScrolling: true).Expected
Smooth synchronized scrolling without rollback/jumps.
Actual
When scrolling fast, panes sometimes "fight" each other and produce setback jitter.
Suspected cause
Both panes have independent throttled
changeScrollTophandlers.Under fast wheel input, delayed/throttled callbacks can execute out of order and compete.
Proposed fix
Use one centralized scroll scheduler:
lastScrollSourcerequestAnimationFrameThis removes throttle competition between left/right handlers.
I attached a patch file:
issue-140-scroll-jitter.patch(contains changes in
src/index.ts)issue-140-scroll-jitter.patch