-
Notifications
You must be signed in to change notification settings - Fork 38
command to restart the REPL without killing the buffer #23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Thank you for your PR! What do you think? |
|
I haven't tought about that, it's way better, and cleaner for sure ! |
|
Do you think it's OK like that ? |
nodejs-repl.el
Outdated
| (defvar nodejs-repl-code-format | ||
| (concat | ||
| "require('repl').start('%s', null, null, true, false, " | ||
| "require('repl').start({prompt: '%s', useGlobal: %s}, null, null, true, false, " |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
repl.start has two signatures, one is repl.start(options) and another is repl.start(prompt, stream, eval, useGlobal, ignoreUndefined, replMode). If you specify a object as the first argument, other arguments are ignored, so please change the code like below:
diff --git a/nodejs-repl.el b/nodejs-repl.el
index 58834bb..32f758c 100644
--- a/nodejs-repl.el
+++ b/nodejs-repl.el
@@ -139,8 +139,8 @@ See also `comint-process-echoes'"
(defvar nodejs-repl-code-format
(concat
- "require('repl').start({prompt: '%s', useGlobal: %s}, null, null, true, false, "
- "require('repl')['REPL_MODE_' + '%s'.toUpperCase()])"))
+ "require('repl').start({ prompt: '%s', useGlobal: %s, replMode: "
+ "require('repl')['REPL_MODE_' + '%s'.toUpperCase()] })"))
(defvar nodejs-repl-extra-espace-sequence-re "\\(\x1b\\[[0-9]+[GJK]\\)")
abicky
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your contribution :)
|
I've published 0.2.1. |
A while ago, I answered this question, and I think the command could be useful to other users.
I'm not experimented at all in elisp, so I'm open to all kind of suggestions,
Cheers