Fix sbt REPL handler

This commit is contained in:
Henrik Lissner 2020-02-25 20:47:18 -05:00
parent 2f251edc87
commit 0ba5c574b9
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -40,11 +40,15 @@ Meant to be used for `scala-mode's `comment-line-break-function'."
(interactive) (interactive)
(if (and (require 'sbt-mode nil t) (if (and (require 'sbt-mode nil t)
(sbt:find-root)) (sbt:find-root))
(run-scala) (let ((buffer-name (sbt:buffer-name)))
(let ((buffer-name "*scala-repl") (unless (comint-check-proc buffer-name)
buffer) (kill-buffer buffer-name))
(unless (comint-check-proc buffer-name) (run-scala)
(setq buffer (make-comint-in-buffer (get-buffer buffer-name))
"scala-repl" buffer-name "scala"))) (let* ((buffer-name "*scala-repl")
(buffer
(if (comint-check-proc buffer-name)
(get-buffer buffer-name)
(make-comint-in-buffer "scala-repl" buffer-name "scala"))))
(display-buffer buffer) (display-buffer buffer)
buffer))) buffer)))