MCPcopy Index your code
hub / github.com/micro-editor/micro / Redo

Method Redo

internal/buffer/eventhandler.go:304–326  ·  view source on GitHub ↗

Redo the first event in the redo stack. Returns false if the stack is empty.

()

Source from the content-addressed store, hash-verified

302
303// Redo the first event in the redo stack. Returns false if the stack is empty.
304func (eh *EventHandler) Redo() bool {
305 t := eh.RedoStack.Peek()
306 if t == nil {
307 return false
308 }
309
310 startTime := t.Time.UnixNano() / int64(time.Millisecond)
311 endTime := startTime - (startTime % undoThreshold) + undoThreshold
312
313 for {
314 t = eh.RedoStack.Peek()
315 if t == nil {
316 break
317 }
318
319 if t.Time.UnixNano()/int64(time.Millisecond) > endTime {
320 break
321 }
322
323 eh.RedoOneEvent()
324 }
325 return true
326}
327
328// RedoOneEvent redoes one event
329func (eh *EventHandler) RedoOneEvent() {

Callers

nothing calls this directly

Calls 2

RedoOneEventMethod · 0.95
PeekMethod · 0.80

Tested by

no test coverage detected