File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -662,18 +662,22 @@ session."
662
662
type (car (sesman-current-session 'CIDER )))
663
663
repl))))
664
664
665
+ (defun cider--match-repl-type (type buffer )
666
+ " Return non-nil if TYPE matches BUFFER's REPL type."
667
+ (let ((buffer-repl-type (cider-repl-type buffer)))
668
+ (cond ((null buffer-repl-type) nil )
669
+ ((or (null type) (equal type " multi" )) t )
670
+ (t (string= type buffer-repl-type)))))
671
+
665
672
(defun cider-repls (&optional type ensure )
666
673
" Return cider REPLs of TYPE from the current session.
667
674
If TYPE is nil or \" multi\" , return all repls. If ENSURE is non-nil, throw
668
675
an error if no linked session exists."
669
676
(let ((repls (cdr (if ensure
670
677
(sesman-ensure-session 'CIDER )
671
678
(sesman-current-session 'CIDER )))))
672
- (if (or (null type) (equal type " multi" ))
673
- repls
674
- (seq-filter (lambda (b )
675
- (string= type (cider-repl-type b)))
676
- repls))))
679
+ (seq-filter (lambda (b )
680
+ (cider--match-repl-type type b)) repls)))
677
681
678
682
(defun cider-map-repls (which function )
679
683
" Call FUNCTION once for each appropriate REPL as indicated by WHICH.
You can’t perform that action at this time.
0 commit comments