Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
* [#3044](https://github.com/clojure-emacs/cider/pull/3044): Dynamically upgrade nREPL connection
* [#3047](https://github.com/clojure-emacs/cider/pull/3047): Fix info/lookup fallback: response has an extra level
* [#2746](https://github.com/clojure-emacs/cider/issues/2746): Handle gracefully Clojure versions with non-standard qualifiers (e.g. `1.11.0-master-SNAPSHOT`).
* [#3069](https://github.com/clojure-emacs/cider/pull/3069): Fix cursor color changing when it shouldn't in evil-mode

## 1.1.1 (2021-05-24)

Expand Down
12 changes: 10 additions & 2 deletions nrepl-client.el
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,11 @@ STACK is as in `nrepl--bdecode-1'. Return a cons (INFO . STACK)."
stack (cdr istack)))
istack))

(defun nrepl--ensure-fundamental-mode ()
"Enable `fundamental-mode' if it is not enabled already."
(when (not (eq 'fundamental-mode major-mode))
(fundamental-mode)))

(defun nrepl-bdecode (string-q &optional response-q)
"Decode STRING-Q and place the results into RESPONSE-Q.
STRING-Q is either a queue of strings or a string. RESPONSE-Q is a queue of
Expand All @@ -374,7 +379,10 @@ decoded. RESPONSE-Q is the original queue with successfully decoded messages
enqueued and with slot STUB containing a nested stack of an incompletely
decoded message or nil if the strings were completely decoded."
(with-current-buffer (get-buffer-create " *nrepl-decoding*")
(fundamental-mode)
;; Don't needlessly call `fundamental-mode', to prevent needlessly firing
;; hooks. This fixes an issue with evil-mode where the cursor loses its
;; correct color.
(nrepl--ensure-fundamental-mode)
(erase-buffer)
(if (queue-p string-q)
(while (queue-head string-q)
Expand Down Expand Up @@ -1352,7 +1360,7 @@ The default buffer name is *nrepl-error*."
(let ((buffer (get-buffer-create nrepl-error-buffer-name)))
(with-current-buffer buffer
(buffer-disable-undo)
(fundamental-mode)
(nrepl--ensure-fundamental-mode)
buffer))))

(defun nrepl-log-error (msg)
Expand Down