Skip to content

Commit

Permalink
Merge branch 'release/0.2.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
abicky committed Oct 24, 2018
2 parents c35297a + 98026d3 commit 3f79caf
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions nodejs-repl.el
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
;; Copyright (C) 2012-2017 Takeshi Arabiki

;; Author: Takeshi Arabiki
;; Version: 0.2.0
;; Version: 0.2.1

;; This program is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -73,7 +73,7 @@
"Run Node.js REPL and communicate the process."
:group 'processes)

(defconst nodejs-repl-version "0.2.0"
(defconst nodejs-repl-version "0.2.1"
"Node.js mode Version.")

(defcustom nodejs-repl-command "node"
Expand All @@ -94,6 +94,10 @@ such as nvm."
:group 'nodejs-repl
:type 'string)

(defcustom nodejs-repl-use-global "false"
"useGlobal option of Node.js REPL method repl.start"
:group 'nodejs-repl
:type 'string)

(defcustom nodejs-repl-input-ignoredups t
"If non-nil, don't add input matching the last on the input ring.
Expand Down Expand Up @@ -135,8 +139,8 @@ See also `comint-process-echoes'"

(defvar nodejs-repl-code-format
(concat
"require('repl').start('%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]\\)")

Expand Down Expand Up @@ -526,7 +530,7 @@ otherwise spawn one."
(shell-command-to-string (concat node-command " --version"))))
(let* ((repl-mode (or (getenv "NODE_REPL_MODE") "magic"))
(nodejs-repl-code (format nodejs-repl-code-format
nodejs-repl-prompt repl-mode )))
nodejs-repl-prompt nodejs-repl-use-global repl-mode)))
(pop-to-buffer
(apply 'make-comint nodejs-repl-process-name node-command nil
`(,@nodejs-repl-arguments "-e" ,nodejs-repl-code)))
Expand Down

0 comments on commit 3f79caf

Please sign in to comment.