diff --git a/pkg/gui/controllers/helpers/diff_line_restore.go b/pkg/gui/controllers/helpers/diff_line_restore.go index c51bbe31b..5cd924cc9 100644 --- a/pkg/gui/controllers/helpers/diff_line_restore.go +++ b/pkg/gui/controllers/helpers/diff_line_restore.go @@ -81,7 +81,7 @@ func (self *DiffLineHelper) PreserveDiffPositionOnRerender(view *gocui.View) { // Put the line back on the screen row it was on, clamped into the view for // the fallback lines, which can come from off screen. row := lo.Clamp(anchor.row, 0, max(0, view.InnerHeight()-1)) - view.SetOrigin(0, max(0, viewLine-row)) + view.SetOriginY(max(0, viewLine-row)) if showSelection { // Put the far end back before the cursor, so that the selection covers // the same lines again; a selection whose far end didn't survive the diff --git a/pkg/gui/tasks_adapter.go b/pkg/gui/tasks_adapter.go index c2db5f1ec..5b87a9d59 100644 --- a/pkg/gui/tasks_adapter.go +++ b/pkg/gui/tasks_adapter.go @@ -233,7 +233,7 @@ func (gui *Gui) getManager(view *gocui.View) *tasks.ViewBufferManager { if linesHeight < originY { newOriginY := linesHeight - view.SetOrigin(0, newOriginY) + view.SetOriginY(newOriginY) } gui.updateDiffPaneDecorations(view, true)