| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 2fa8170 commit 2a74a1e
3 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1477,16 +1477,16 @@ function defineDefaultCommands(repl) { | |||
| 1477 | 1477 | this.displayPrompt(); | |
| 1478 | 1478 | } | |
| 1479 | 1479 | }); | |
| 1480 | - | ||
| 1481 | - repl.defineCommand('editor', { | ||
| 1482 | - help: 'Enter editor mode', | ||
| 1483 | - action() { | ||
| 1484 | - if (!this.terminal) return; | ||
| 1485 | - _turnOnEditorMode(this); | ||
| 1486 | - this.outputStream.write( | ||
| 1487 | - '// Entering editor mode (^D to finish, ^C to cancel)\n'); | ||
| 1488 | - } | ||
| 1489 | - }); | ||
| 1480 | + if (repl.terminal) { | ||
| 1481 | + repl.defineCommand('editor', { | ||
| 1482 | + help: 'Enter editor mode', | ||
| 1483 | + action() { | ||
| 1484 | + _turnOnEditorMode(this); | ||
| 1485 | + this.outputStream.write( | ||
| 1486 | + '// Entering editor mode (^D to finish, ^C to cancel)\n'); | ||
| 1487 | + } | ||
| 1488 | + }); | ||
| 1489 | + } | ||
| 1490 | 1490 | } | |
| 1491 | 1491 | ||
| 1492 | 1492 | function regexpEscape(s) { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -61,7 +61,7 @@ assert.strictEqual(fs.readFileSync(saveFileName, 'utf8'), | |||
| 61 | 61 | '}' | |
| 62 | 62 | ]; | |
| 63 | 63 | const putIn = new ArrayStream(); | |
| 64 | - const replServer = repl.start('', putIn); | ||
| 64 | + const replServer = repl.start({ terminal: true, stream: putIn }); | ||
| 65 | 65 | ||
| 66 | 66 | putIn.run(['.editor']); | |
| 67 | 67 | putIn.run(cmds); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -439,7 +439,6 @@ const errorTests = [ | |||
| 439 | 439 | expect: [ | |
| 440 | 440 | /\.break/, | |
| 441 | 441 | /\.clear/, | |
| 442 | - /\.editor/, | ||
| 443 | 442 | /\.exit/, | |
| 444 | 443 | /\.help/, | |
| 445 | 444 | /\.load/, | |
| Back | FazBrowse Home | New Git URL |
0 commit comments