check if buffer exists and not alive before kill

This commit is contained in:
Sam Pillsworth 2021-02-07 12:04:15 -05:00
parent 16a495c97d
commit 394e166894

View file

@ -41,7 +41,7 @@ Meant to be used for `scala-mode's `comment-line-break-function'."
(if (and (require 'sbt-mode nil t)
(sbt:find-root))
(let ((buffer-name (sbt:buffer-name)))
(unless (comint-check-proc buffer-name)
(when (and (get-buffer buffer-name) (not (comint-check-proc buffer-name)))
(kill-buffer buffer-name))
(run-scala)
(get-buffer buffer-name))