MCPcopy Create free account
hub / github.com/cogentcore/core / undo

Method undo

texteditor/buffer.go:824–835  ·  view source on GitHub ↗

Undo undo undoes next group of items on the undo stack

()

Source from the content-addressed store, hash-verified

822
823// undo undoes next group of items on the undo stack
824func (tb *Buffer) undo() []*text.Edit {
825 autoSave := tb.batchUpdateStart()
826 defer tb.batchUpdateEnd(autoSave)
827 tbe := tb.Lines.Undo()
828 if tbe == nil || tb.Undos.Pos == 0 { // no more undo = fully undone
829 tb.SetChanged(false)
830 tb.notSaved = false
831 tb.AutoSaveDelete()
832 }
833 tb.signalMods()
834 return tbe
835}
836
837// redo redoes next group of items on the undo stack,
838// and returns the last record, nil if no more

Callers

nothing calls this directly

Calls 6

batchUpdateStartMethod · 0.95
batchUpdateEndMethod · 0.95
AutoSaveDeleteMethod · 0.95
signalModsMethod · 0.95
SetChangedMethod · 0.80
UndoMethod · 0.45

Tested by

no test coverage detected