File tree Expand file tree Collapse file tree 1 file changed +11
-9
lines changed Expand file tree Collapse file tree 1 file changed +11
-9
lines changed Original file line number Diff line number Diff line change @@ -178,17 +178,19 @@ connections are returned, instead of just the most recent."
178
178
cider-connections
179
179
(car cider-connections)))))
180
180
181
- (defun cider-connection-type-for-buffer ()
182
- " Return the matching connection type (clj or cljs) for the current buffer .
181
+ (defun cider-connection-type-for-buffer (&optional buffer )
182
+ " Return the matching connection type (clj or cljs) for BUFFER .
183
183
In cljc and cljx buffers return \" multi\" . This function infers connection
184
184
type based on the major mode. See `cider-project-connections-types' for a
185
- list of types of actual connections within a project."
186
- (cond
187
- ((derived-mode-p 'clojurescript-mode ) " cljs" )
188
- ((derived-mode-p 'clojurec-mode ) " multi" )
189
- ((derived-mode-p 'clojurex-mode ) " multi" )
190
- ((derived-mode-p 'clojure-mode ) " clj" )
191
- (cider-repl-type)))
185
+ list of types of actual connections within a project. BUFFER defaults to
186
+ the `current-buffer' ."
187
+ (with-current-buffer (or buffer (current-buffer ))
188
+ (cond
189
+ ((derived-mode-p 'clojurescript-mode ) " cljs" )
190
+ ((derived-mode-p 'clojurec-mode ) " multi" )
191
+ ((derived-mode-p 'clojurex-mode ) " multi" )
192
+ ((derived-mode-p 'clojure-mode ) " clj" )
193
+ (cider-repl-type))))
192
194
193
195
(defun cider-project-connections-types ()
194
196
" Return a list of types of connections within current project."
You can’t perform that action at this time.
0 commit comments