aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/ScriptingRepl.tsx
diff options
context:
space:
mode:
authorandrewdkim <adkim414@gmail.com>2019-09-21 14:24:05 -0400
committerandrewdkim <adkim414@gmail.com>2019-09-21 14:24:05 -0400
commitc0dc4928c29e043ae897f4f7c58168831c3d8fd5 (patch)
tree214173886faf8a7bcd47fd384e3341c2f8158658 /src/client/views/ScriptingRepl.tsx
parent53c4f6ddad5534101d7a7482332cddb02ba99c21 (diff)
parent1d5dc3eb4095cea017412de9519b8eaee979c16c (diff)
merge from master
Diffstat (limited to 'src/client/views/ScriptingRepl.tsx')
-rw-r--r--src/client/views/ScriptingRepl.tsx20
1 files changed, 9 insertions, 11 deletions
diff --git a/src/client/views/ScriptingRepl.tsx b/src/client/views/ScriptingRepl.tsx
index e05195ca0..1eb380e0b 100644
--- a/src/client/views/ScriptingRepl.tsx
+++ b/src/client/views/ScriptingRepl.tsx
@@ -135,19 +135,17 @@ export class ScriptingRepl extends React.Component {
this.commands.push({ command: this.commandString, result: script.errors });
return;
}
- const result = script.run({ args: this.args });
- if (!result.success) {
- this.commands.push({ command: this.commandString, result: result.error.toString() });
- return;
- }
- this.commands.push({ command: this.commandString, result: result.result });
- this.commandsHistory.push(this.commandString);
+ const result = script.run({ args: this.args }, e => this.commands.push({ command: this.commandString, result: e.toString() }));
+ if (result.success) {
+ this.commands.push({ command: this.commandString, result: result.result });
+ this.commandsHistory.push(this.commandString);
- this.maybeScrollToBottom();
+ this.maybeScrollToBottom();
- this.commandString = "";
- this.commandBuffer = "";
- this.historyIndex = -1;
+ this.commandString = "";
+ this.commandBuffer = "";
+ this.historyIndex = -1;
+ }
break;
}
case "ArrowUp": {