undo/redo: Remove no longer needed teCursor temp var

This commit is contained in:
Dmytro Maluka
2024-08-04 13:56:03 +02:00
parent 658c20ff2a
commit 0d51035acd

View File

@@ -291,12 +291,9 @@ func (eh *EventHandler) UndoOneEvent() {
eh.UndoTextEvent(t)
// Set the cursor in the right place
teCursor := t.C
if teCursor.Num >= 0 && teCursor.Num < len(eh.cursors) {
eh.cursors[teCursor.Num].Goto(teCursor)
eh.cursors[teCursor.Num].NewTrailingWsY = teCursor.NewTrailingWsY
} else {
teCursor.Num = -1
if t.C.Num >= 0 && t.C.Num < len(eh.cursors) {
eh.cursors[t.C.Num].Goto(t.C)
eh.cursors[t.C.Num].NewTrailingWsY = t.C.NewTrailingWsY
}
// Push it to the redo stack
@@ -335,12 +332,9 @@ func (eh *EventHandler) RedoOneEvent() {
return
}
teCursor := t.C
if teCursor.Num >= 0 && teCursor.Num < len(eh.cursors) {
eh.cursors[teCursor.Num].Goto(teCursor)
eh.cursors[teCursor.Num].NewTrailingWsY = teCursor.NewTrailingWsY
} else {
teCursor.Num = -1
if t.C.Num >= 0 && t.C.Num < len(eh.cursors) {
eh.cursors[t.C.Num].Goto(t.C)
eh.cursors[t.C.Num].NewTrailingWsY = t.C.NewTrailingWsY
}
// Modifies the text event