Skip to content

Commit 4dd1526

Browse files
author
Bozhidar Batsov
committed
Don't display the ns result when switching between namespaces
1 parent 217ec38 commit 4dd1526

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

cider-repl.el

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -659,6 +659,17 @@ text property `cider-old-input'."
659659
(cider-eval-and-get-value
660660
"(clojure.core/map clojure.core/str (clojure.core/all-ns))"))
661661

662+
(defun cider-repl-switch-ns-handler (buffer)
663+
"Make a nREPL evaluation handler for the REPL ns switching."
664+
(nrepl-make-response-handler buffer
665+
(lambda (buffer value))
666+
(lambda (buffer out)
667+
(cider-repl-emit-output buffer out))
668+
(lambda (buffer err)
669+
(cider-repl-emit-err-output buffer err))
670+
(lambda (buffer)
671+
(cider-repl-emit-prompt buffer))))
672+
662673
(defun cider-repl-set-ns (ns)
663674
"Switch the namespace of the REPL buffer to NS.
664675
@@ -672,7 +683,7 @@ namespace to switch to."
672683
(with-current-buffer (cider-current-repl-buffer)
673684
(cider-eval
674685
(format "(in-ns '%s)" ns)
675-
(cider-repl-handler (current-buffer))))
686+
(cider-repl-switch-ns-handler (current-buffer))))
676687
(error "Cannot determine the current namespace")))
677688

678689

0 commit comments

Comments
 (0)