diff options
author | James Hu <51237606+jameshu111@users.noreply.github.com> | 2023-07-26 12:15:46 -0400 |
---|---|---|
committer | James Hu <51237606+jameshu111@users.noreply.github.com> | 2023-07-26 12:15:46 -0400 |
commit | 4a8cf5ee3fd6f01ff2d28ccc0a456e9782bd261b (patch) | |
tree | a1a4ac7200a38f55227fff941d8d7246cb85eebf /src/client/views/ScriptingRepl.tsx | |
parent | 7c1017f15b9c0ad09d3e0185e310733ab7c10c09 (diff) | |
parent | c87024c06941920f1df689d54d82cc309891e3d2 (diff) |
Merge branch 'master' into james-azure-image
Diffstat (limited to 'src/client/views/ScriptingRepl.tsx')
-rw-r--r-- | src/client/views/ScriptingRepl.tsx | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/client/views/ScriptingRepl.tsx b/src/client/views/ScriptingRepl.tsx index 5dfe10def..2bc2d5e6b 100644 --- a/src/client/views/ScriptingRepl.tsx +++ b/src/client/views/ScriptingRepl.tsx @@ -5,6 +5,7 @@ import * as React from 'react'; import { DocumentManager } from '../util/DocumentManager'; import { CompileScript, Transformer, ts } from '../util/Scripting'; import { ScriptingGlobals } from '../util/ScriptingGlobals'; +import { undoable } from '../util/UndoManager'; import { DocumentIconContainer } from './nodes/DocumentIcon'; import { OverlayView } from './OverlayView'; import './ScriptingRepl.scss'; @@ -161,7 +162,7 @@ export class ScriptingRepl extends React.Component { this.commands.push({ command: this.commandString, result: script.errors }); return; } - const result = script.run({ args: this.args }, e => this.commands.push({ command: this.commandString, result: e.toString() })); + const result = undoable(() => script.run({ args: this.args }, e => this.commands.push({ command: this.commandString, result: e.toString() })), 'run:' + this.commandString)(); if (result.success) { this.commands.push({ command: this.commandString, result: result.result }); this.commandsHistory.push(this.commandString); |