diff options
author | andrewdkim <adkim414@gmail.com> | 2019-10-01 18:55:50 -0400 |
---|---|---|
committer | andrewdkim <adkim414@gmail.com> | 2019-10-01 18:55:50 -0400 |
commit | 23619154f8688ffcb25a988158d75934c0cacbf7 (patch) | |
tree | d7462da0f0e8b9de091263af166959872e8af0f6 /src/client/views/ScriptingRepl.tsx | |
parent | 45b9f489033cd323614463ca9c36f41900bf1965 (diff) | |
parent | 69e4a936c4eb0cc2e35e4e7f3258aed1f72b8da7 (diff) |
still unfinished
Diffstat (limited to 'src/client/views/ScriptingRepl.tsx')
-rw-r--r-- | src/client/views/ScriptingRepl.tsx | 20 |
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": { |