summaryrefslogtreecommitdiffstats
path: root/pkg
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2018-09-22 13:44:48 +1000
committerJesse Duffield <jessedduffield@gmail.com>2018-09-22 13:49:58 +1000
commit619c28ce56c50b6472d75158211f4bc6141b1bfd (patch)
tree111739990c1072ef143e40e05d607ff573aa9c10 /pkg
parent3101c505821bf225151d0069f2f617382f5bc83b (diff)
use lineheight rather than buffer length
Diffstat (limited to 'pkg')
-rw-r--r--pkg/gui/view_helpers.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/pkg/gui/view_helpers.go b/pkg/gui/view_helpers.go
index 5178bd4d9..e9362c41f 100644
--- a/pkg/gui/view_helpers.go
+++ b/pkg/gui/view_helpers.go
@@ -183,7 +183,7 @@ func (gui *Gui) cursorDown(g *gocui.Gui, v *gocui.View) error {
}
cx, cy := v.Cursor()
ox, oy := v.Origin()
- ly := len(v.BufferLines()) - 1
+ ly := v.LinesHeight() - 1
_, height := v.Size()
maxY := height - 1
@@ -219,7 +219,7 @@ func (gui *Gui) correctCursor(v *gocui.View) error {
ox, oy := v.Origin()
_, height := v.Size()
maxY := height - 1
- ly := len(v.BufferLines()) - 1
+ ly := v.LinesHeight() - 1
if oy+cy <= ly {
return nil
}