implement home and end shortcuts

This commit is contained in:
Felix Angell 2018-04-13 14:44:04 +01:00
parent b4dd8c0151
commit cecb529cc4
2 changed files with 14 additions and 0 deletions

View File

@ -452,6 +452,20 @@ func (b *Buffer) processActionKey(key int) bool {
}
return true
case sdl.K_END:
currLine := b.contents[b.curs.y]
if b.curs.x < currLine.Len() {
distToMove := currLine.Len() - b.curs.x
b.curs.move(distToMove, 0)
}
return true
case sdl.K_HOME:
if b.curs.x > 0 {
b.curs.move(-b.curs.x, 0)
}
return true
case sdl.K_LGUI:
fallthrough
case sdl.K_RGUI:

Binary file not shown.