Fix scrolling back when dragging a commit

During auto-scrolling, turn off the automatic
scroll-to-make-the-selected-item-visible functionality of
PostRefreshUpdate.
This commit is contained in:
Stefan Haller 2026-08-26 18:53:55 +02:00
parent c8d610cb58
commit 35753fd042
2 changed files with 1 additions and 5 deletions

View file

@ -191,7 +191,7 @@ func (self *LocalCommitsController) handleCommitDrag(opts gocui.ViewMouseBinding
self.commitDrag.hasMoved = true
if self.updateCommitDragInsertion(opts.Y) {
self.c.PostRefreshUpdate(self.context())
self.c.PostRefreshUpdateKeepingScrollPosition(self.context())
}
originY := self.context().GetView().OriginY()
self.dragAutoscroller.Update(opts.Y - originY)

View file

@ -27,12 +27,8 @@ var DragToReorderWithAutoscroll = NewIntegrationTest(NewIntegrationTestArgs{
OriginYAtLeast(3).
// Move the mouse back into the viewport
MouseMove(1, 1).
/* EXPECTED:
// This keeps the scroll as it was
OriginYAtLeast(3).
ACTUAL: */
// This snaps back to reveal the original commit
OriginY(0).
MouseRelease().
SelectedLines(
Contains("commit-40"),