MCPcopy Create free account
hub / github.com/Moddable-OpenSource/moddable / doUndo

Method doUndo

tools/xsbug/behaviors.js:109–120  ·  view source on GitHub ↗
(code)

Source from the content-addressed store, hash-verified

107 this.onSelected(code);
108 }
109 doUndo(code) {
110 if (this.historyIndex == this.history.length)
111 this.history.push(new CodeState(code));
112 this.historyIndex--;
113 var state = this.history[this.historyIndex];
114 code.string = state.string;
115 code.select(state.selectionOffset, state.selectionLength);
116 this.insertionOffset = -1;
117 this.onEdited(code);
118 this.onSelected(code);
119 this.onReveal(code);
120 }
121 filterKey(code, key) {
122 if (!key) return null;
123 var c = key.charCodeAt(0);

Callers

nothing calls this directly

Calls 5

onEditedMethod · 0.95
onSelectedMethod · 0.95
onRevealMethod · 0.95
pushMethod · 0.45
selectMethod · 0.45

Tested by

no test coverage detected