mirror of
https://github.com/felixangell/phi.git
synced 2024-08-16 19:20:21 +03:00
implement home and end shortcuts
This commit is contained in:
parent
b4dd8c0151
commit
cecb529cc4
@ -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:
|
||||
|
BIN
phi-editor
BIN
phi-editor
Binary file not shown.
Loading…
Reference in New Issue
Block a user