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

@ -46,7 +46,7 @@ Micro is devel-only for now because there is no released version.
### Prebuilt binaries
| Download |
| Nightly Binaries |
| --- |
| [Mac OS X](http://zbyedidia.webfactional.com/micro/binaries/micro-osx.tar.gz) |
| [64 bit Linux](http://zbyedidia.webfactional.com/micro/binaries/micro-linux64.tar.gz) |

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()