File tree Expand file tree Collapse file tree 1 file changed +6
-14
lines changed
Expand file tree Collapse file tree 1 file changed +6
-14
lines changed Original file line number Diff line number Diff line change @@ -291,13 +291,9 @@ func (eh *EventHandler) UndoOneEvent() {
291291 eh .UndoTextEvent (t )
292292
293293 // Set the cursor in the right place
294- teCursor := t .C
295- if teCursor .Num >= 0 && teCursor .Num < len (eh .cursors ) {
296- t .C = * eh .cursors [teCursor .Num ]
297- eh .cursors [teCursor .Num ].Goto (teCursor )
298- eh .cursors [teCursor .Num ].NewTrailingWsY = teCursor .NewTrailingWsY
299- } else {
300- teCursor .Num = - 1
294+ if t .C .Num >= 0 && t .C .Num < len (eh .cursors ) {
295+ eh .cursors [t .C .Num ].Goto (t .C )
296+ eh .cursors [t .C .Num ].NewTrailingWsY = t .C .NewTrailingWsY
301297 }
302298
303299 // Push it to the redo stack
@@ -336,13 +332,9 @@ func (eh *EventHandler) RedoOneEvent() {
336332 return
337333 }
338334
339- teCursor := t .C
340- if teCursor .Num >= 0 && teCursor .Num < len (eh .cursors ) {
341- t .C = * eh .cursors [teCursor .Num ]
342- eh .cursors [teCursor .Num ].Goto (teCursor )
343- eh .cursors [teCursor .Num ].NewTrailingWsY = teCursor .NewTrailingWsY
344- } else {
345- teCursor .Num = - 1
335+ if t .C .Num >= 0 && t .C .Num < len (eh .cursors ) {
336+ eh .cursors [t .C .Num ].Goto (t .C )
337+ eh .cursors [t .C .Num ].NewTrailingWsY = t .C .NewTrailingWsY
346338 }
347339
348340 // Modifies the text event
You can’t perform that action at this time.
0 commit comments