From fb0004481b445b30b8180ddb27fb61e3c541337a Mon Sep 17 00:00:00 2001 From: Jesse Duffield Date: Mon, 13 Aug 2018 21:42:56 +1000 Subject: [PATCH] correct cursor before returning item position --- pkg/gui/view_helpers.go | 1 + 1 file changed, 1 insertion(+) diff --git a/pkg/gui/view_helpers.go b/pkg/gui/view_helpers.go index a3e2877c3..331e27975 100644 --- a/pkg/gui/view_helpers.go +++ b/pkg/gui/view_helpers.go @@ -118,6 +118,7 @@ func (gui *Gui) switchFocus(g *gocui.Gui, oldView, newView *gocui.View) error { } func (gui *Gui) getItemPosition(v *gocui.View) int { + gui.correctCursor(v) _, cy := v.Cursor() _, oy := v.Origin() return oy + cy