You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix inline-mode click-to-jump jiggle via predicted-settle ghost
In inline mode the editor's ExtentHeight covers the inline document
(including deletion lines), but the overview bar paints the viewport
band from the right/left source-line counts. Sending raction *
ExtentHeight to the editor and pinning the ghost at the cursor's bar
position therefore landed at two different coordinate systems: the
editor settled at one inline line, while the bar's band repainted at
the corresponding RightFirstLine, which could be 25-30 px off the
cursor in a mid-sized file with deletions interleaved.
Add DiffPaneViewModel.PredictBandTopFractionForScroll, which walks
InlineLineToSourceLines forward from the predicted first inline line
to find what (LeftFirstLine, RightFirstLine) the bar will paint after
settle, and returns min(leftFrac, rightFrac) to match how the
geometry layer's GetBandTopY picks the band's top. The bar uses this
prediction to place the ghost where the band will actually settle,
so MouseDown -> MouseUp -> editor settle all land on the same pixel.
In side-by-side mode the prediction is identity and behaviour is
unchanged.
Remove the deferred ghost-clear scaffolding (_ghostClearPending,
_ghostClearTimer, GhostClearTimeout, EnsureGhostClearTimer,
OnGhostClearTimerTick, the pending-clear branch in
OnMouseLeftButtonDown, the deferred-clear path in ResetInteraction):
it was a 250 ms timer-based workaround for this same root cause and
is dead weight now that the ghost and settled positions coincide.
Restore the empty-space click path to set the ghost via
EmitDragScroll, replacing the previous skip-ghost workaround
(ef8757e) that pre-emptively hid the band on click to mask the same
jiggle.
Four new unit tests cover the prediction directly via the internal
static helper: side-by-side identity, empty-map passthrough, the
pure-delete-in-middle case (validating min(leftFrac, rightFrac)),
walking past a leading delete to find the first non-null newLine,
and NaN / out-of-range input normalization.
AI-Local-Session: b53d5fe5-38cc-41dd-b987-3def5ef3f0d3
AI-Cloud-Session: 744dd836-01e5-48af-91db-daa8241a01d7
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
0 commit comments