Skip to content

Commit 3cdb983

Browse files
authored
Merge pull request #18 from Apteryks/fix-multi-line-regions
Use the editor mode of the REPL to send regions.
2 parents 4a4104d + 1eb95dc commit 3cdb983

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

nodejs-repl.el

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -374,8 +374,13 @@ when receive the output string"
374374
"Send the current region to the `nodejs-repl-process'"
375375
(interactive "r")
376376
(let ((proc (nodejs-repl--get-or-create-process)))
377+
;; Enclose the region in .editor ... EOF as this is more robust.
378+
;; See: https://github.com/abicky/nodejs-repl.el/issues/17
379+
(comint-send-string proc ".editor\n")
377380
(comint-send-region proc start end)
378-
(comint-send-string proc "\n")))
381+
(comint-send-string proc "\n")
382+
(with-current-buffer (process-buffer proc)
383+
(comint-send-eof))))
379384

380385
;;;###autoload
381386
(defun nodejs-repl-send-buffer ()

0 commit comments

Comments
 (0)