aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTulir Asokan <tulir@maunium.net>2020-02-19 23:48:47 +0200
committerTulir Asokan <tulir@maunium.net>2020-02-19 23:48:47 +0200
commitb6e20af056ff9968d6493cca7a8471b2d873281e (patch)
tree0417a3657c91b6b5bcf2d986b5cf8256a2c44e0e
parent55f58f2875d68a47af4c36fac140fb06ecc37bfd (diff)
Always set cursor to end when switching edit message
-rw-r--r--ui/room-view.go3
1 files changed, 1 insertions, 2 deletions
diff --git a/ui/room-view.go b/ui/room-view.go
index 8132b8c..126f1ff 100644
--- a/ui/room-view.go
+++ b/ui/room-view.go
@@ -380,6 +380,7 @@ func (view *RoomView) SetEditing(evt *event.Event) {
view.input.SetText(text)
}
view.status.SetText(view.GetStatus())
+ view.input.SetCursorOffset(-1)
}
func (view *RoomView) findMessageToEdit(forward bool) *event.Event {
@@ -409,14 +410,12 @@ func (view *RoomView) EditNext() {
}
foundEvent := view.findMessageToEdit(true)
view.SetEditing(foundEvent)
- view.input.SetCursorOffset(-1)
}
func (view *RoomView) EditPrevious() {
foundEvent := view.findMessageToEdit(false)
if foundEvent != nil {
view.SetEditing(foundEvent)
- view.input.SetCursorOffset(0)
}
}