Skip to content

Commit 4867db8

Browse files
vspinubbatsov
authored andcommitted
[Fix #2058] Don't cache non-existing ns-forms
1 parent ba66d22 commit 4867db8

File tree

3 files changed

+17
-1
lines changed

3 files changed

+17
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
### Bugs Fixed
1010

11+
* [#2058](https://github.com/clojure-emacs/cider/pull/2058) Don't cache ns-forms in buffers with no such forms.
1112
* [#2057](https://github.com/clojure-emacs/cider/pull/2057) Use `cider--font-lock-ensure` for compatibility with Emacs 24.5.
1213

1314
## 0.15.0 (2017-07-20)

cider-interaction.el

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1604,7 +1604,8 @@ ClojureScript REPL exists for the project, it is evaluated in both REPLs."
16041604
(ns-form (cider-ns-form)))
16051605
(cider-map-connections
16061606
(lambda (connection)
1607-
(cider-repl--cache-ns-form ns-form connection)
1607+
(when ns-form
1608+
(cider-repl--cache-ns-form ns-form connection))
16081609
(cider-request:load-file (cider-file-string filename)
16091610
(funcall cider-to-nrepl-filename-function
16101611
(cider--server-filename filename))

test/cider-client-tests.el

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,20 @@ SYMBOL is locally let-bound to the current buffer."
111111
(setq major-mode 'clojurescript-mode)
112112
(expect (cider-current-connection) :to-equal bb2)))))))
113113

114+
(describe "when current buffer is a 'multi' buffer"
115+
(describe "when there is only one connection available"
116+
(it "returns the only connection"
117+
(with-connection-buffer "clj" b
118+
(with-temp-buffer
119+
(clojure-mode)
120+
(expect (cider-current-connection "clj") :to-equal b))
121+
(with-temp-buffer
122+
(clojurec-mode)
123+
(expect (cider-current-connection "clj") :to-equal b))
124+
(with-temp-buffer
125+
(clojurex-mode)
126+
(expect (cider-current-connection "clj") :to-equal b))))))
127+
114128
(describe "when type argument is given"
115129
(describe "when connection of that type exists"
116130
(it "returns that connection buffer"

0 commit comments

Comments
 (0)