[clojure] Check for nrepl-server-buffer in advice
When using cider-connect to an external server this function would throw an exception because nrepl-server-buffer is nil
This commit is contained in:
parent
d407b3355a
commit
17957a666d
1 changed files with 6 additions and 5 deletions
|
@ -57,11 +57,12 @@
|
||||||
(add-hook! 'cider-connected-hook
|
(add-hook! 'cider-connected-hook
|
||||||
(defun +clojure--cider-dump-nrepl-server-log-h ()
|
(defun +clojure--cider-dump-nrepl-server-log-h ()
|
||||||
"Copy contents of *nrepl-server* to beginning of *cider-repl*."
|
"Copy contents of *nrepl-server* to beginning of *cider-repl*."
|
||||||
|
(when (buffer-live-p nrepl-server-buffer)
|
||||||
(save-excursion
|
(save-excursion
|
||||||
(goto-char (point-min))
|
(goto-char (point-min))
|
||||||
(insert
|
(insert
|
||||||
(with-current-buffer nrepl-server-buffer
|
(with-current-buffer nrepl-server-buffer
|
||||||
(buffer-string))))))
|
(buffer-string)))))))
|
||||||
|
|
||||||
;; The CIDER welcome message obscures error messages that the above code is
|
;; The CIDER welcome message obscures error messages that the above code is
|
||||||
;; supposed to be make visible.
|
;; supposed to be make visible.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue