diff options
Diffstat (limited to 'pkg/gui/tasks_adapter.go')
-rw-r--r-- | pkg/gui/tasks_adapter.go | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/pkg/gui/tasks_adapter.go b/pkg/gui/tasks_adapter.go index d619c58ba..745cc3760 100644 --- a/pkg/gui/tasks_adapter.go +++ b/pkg/gui/tasks_adapter.go @@ -98,21 +98,15 @@ func (gui *Gui) getManager(view *gocui.View) *tasks.ViewBufferManager { }, func() { // Need to check if the content of the view is well past the origin. - // It would be better to use .ViewLinesHeight here (given it considers - // wrapping) but when this function is called they haven't been written to yet. - linesHeight := view.LinesHeight() - _, height := view.Size() + linesHeight := view.ViewLinesHeight() _, originY := view.Origin() if linesHeight < originY { - newOriginY := linesHeight - height - if newOriginY < 0 { - newOriginY = 0 - } + newOriginY := linesHeight + err := view.SetOrigin(0, newOriginY) if err != nil { panic(err) } - } view.FlushStaleCells() |