From 1d9d0c3a4d7ab3bdc940328a2099242986edcaa9 Mon Sep 17 00:00:00 2001 From: Zachary Yedidia Date: Sun, 24 Apr 2016 14:40:30 -0400 Subject: [PATCH] Fix PageUp and PageDown bindings Fixes #72. --- cmd/micro/bindings.go | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/cmd/micro/bindings.go b/cmd/micro/bindings.go index 4e036453..515133ef 100644 --- a/cmd/micro/bindings.go +++ b/cmd/micro/bindings.go @@ -232,8 +232,8 @@ func DefaultBindings() map[string]string { "CtrlA": "SelectAll", "Home": "Beginning", "End": "End", - "PageUp": "PageUp", - "PageDown": "PageDown", + "PgUp": "PageUp", + "PgDn": "PageDown", "CtrlU": "HalfPageUp", "CtrlD": "HalfPageDown", "CtrlR": "ToggleRuler", @@ -589,10 +589,8 @@ func PageUp(v *View) bool { func PageDown(v *View) bool { if len(v.buf.lines)-(v.topline+v.height) > v.height { v.ScrollDown(v.height) - } else { - if len(v.buf.lines) >= v.height { - v.topline = len(v.buf.lines) - v.height - } + } else if len(v.buf.lines) >= v.height { + v.topline = len(v.buf.lines) - v.height } return false }