-
-
Notifications
You must be signed in to change notification settings - Fork 645
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Fix #1297] C-c M-n should act on both repls #1397
Conversation
(cons | ||
(cider-other-connection (cider-current-connection)) | ||
connections) | ||
connections))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Kinda minor nitpick, but I think it reads a little better if you remove the second binding and use this inside the let
body.
(when (or (derived-mode-p 'clojurec-mode)
(derived-mode-p 'clojurex-mode))
(push (cider-other-connection (cider-current-connection))
connections))
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, and it needs to account for the fact that (cider-other-connection (cider-current-connection)) might be nil.
46b5027
to
648f20c
Compare
Make `project-directory` optional in `cider-find-connection-buffer-for-project-directory`. The default value is found using `(clojure-project-dir)` starting at `(cider-current-dir)`. This is the most common use-case and should be made easy.
648f20c
to
caeb6d3
Compare
Rewritten to address all comments. Thanks guys :) |
caeb6d3
to
3b79b3f
Compare
👍 |
@@ -220,6 +226,15 @@ file extension." | |||
;; TODO: Add logic to dispatch to a matching Clojure/ClojureScript REPL based on file type | |||
(car cider-connections))) | |||
|
|||
(defun cider-other-connection (connection) | |||
"Return the first connection of another type than CONNECTION or nil." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here it should say the connection has the same project.
This also needs a changelog entry. Sorry about the extra comments - I was interrupted while going though the code the previous time. |
@@ -761,18 +761,26 @@ text property `cider-old-input'." | |||
(defun cider-repl-set-ns (ns) | |||
"Switch the namespace of the REPL buffer to NS. | |||
|
|||
If invoked in a REPL buffer the command will prompt you for the name of the | |||
If called from a cljc or cljx buffer act on both the Clojure and | |||
ClojureScript REPL if there are more than one REPL present. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if there is more than one (otherwise it should be REPLs I think)
In a cljc or cljx buffer hitting `C-c M-n` to switch the repl ns will now act on both repls so they are in sync.
3b79b3f
to
e67be7e
Compare
[Fix #1297] C-c M-n should act on both repls
👍 |
In a cljc or cljx buffer hitting
C-c M-n
to switch the repl ns will now act on both repls so they are in sync.