Skip to content

Commit

Permalink
Fix the setting of REPL namespace
Browse files Browse the repository at this point in the history
We used to set the ns before switching the to ns buffer, but that's
no longer correct after the introduction of smart REPL selection.
The ns has to be set after you've switched to the right REPL buffer.
  • Loading branch information
bbatsov committed Aug 14, 2015
1 parent 5c5ee90 commit cfbe137
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions cider-interaction.el
Original file line number Diff line number Diff line change
Expand Up @@ -440,11 +440,13 @@ When SET-NAMESPACE is t, sets the namespace in the REPL buffer to
that of the namespace in the Clojure source buffer."
(cider-ensure-connected)
(let ((buffer (current-buffer)))
(when set-namespace
(cider-repl-set-ns (cider-current-ns)))
;; first we switch to the REPL buffer
(if cider-repl-display-in-current-window
(pop-to-buffer-same-window repl-buffer)
(pop-to-buffer repl-buffer))
;; then if necessary we update its namespace
(when set-namespace
(cider-repl-set-ns (with-current-buffer buffer (cider-current-ns))))
(cider-remember-clojure-buffer buffer)
(goto-char (point-max))))

Expand Down

0 comments on commit cfbe137

Please sign in to comment.