Fix end key behavior

Fixes #28
This commit is contained in:
Zachary Yedidia
2016-04-18 21:24:15 -04:00
parent aa129c1ddf
commit c264fec472
2 changed files with 6 additions and 2 deletions

View File

@@ -489,7 +489,11 @@ func (v *View) HandleEvent(event tcell.Event) {
v.topline = 0
relocate = false
case tcell.KeyEnd:
v.topline = len(v.buf.lines) - 1 - v.height
if v.height > len(v.buf.lines) {
v.topline = 0
} else {
v.topline = len(v.buf.lines) - v.height
}
relocate = false
case tcell.KeyPgUp:
v.PageUp()