-
-
Notifications
You must be signed in to change notification settings - Fork 643
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
Add cider-load-buffer-and-switch-to-repl-buffer #1232
Conversation
This behavior would make a lot of sense to me under |
We thought through the command sequence, and we've concluded that the
Using
|
I have updated the function to accept universal arguments a la However, when running |
👍 This also reduces the cognitive load of yet another keybinding, but just barely :/ |
If I'm loading a file and switching to the REPL as a single action, I almost certainly want the namespace to be loaded on the REPL.
This looks much more useful than the other one.
It's good to maintain symmetry where we can, but limiting the number of keybinds is important too. Cider is already starting to run out of these. ;-) I like this proposal: C-c C-k = load buffer |
A counter point: if you're working in I agree the more common case should be shorter. However, it isn't with When considering |
@@ -814,6 +814,8 @@ Keyboard shortcut | Description | |||
<kbd>C-c M-n</kbd> | Switch the namespace of the REPL buffer to the namespace of the current buffer. | |||
<kbd>C-c C-z</kbd> | Switch to the relevant REPL buffer. Use a prefix argument to change the namespace of the REPL buffer to match the currently visited source file. | |||
<kbd>C-u C-u C-c C-z</kbd> | Switch to the REPL buffer based on a user prompt for a directory. | |||
<kbd>C-c M-z</kbd> | Load (eval) the current buffer and switch to the relevant REPL buffer. Use a prefix argument to change the namespace of the REPL buffer to match the currently visited source file. | |||
<kbd>C-u C-u C-c M-z</kbd> | Load (eval) the current buffer and switch to the REPL buffer based on a user prompt for a directory. |
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.
Two prefix args?
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.
See my comment above: #1232 (comment)
I'm fine with the idea, but I'm not sure what the default behaviour should be. Seems there might be some point in switching the ns by default, but on the other hand this won't be consistent with the current go-to-repl behaviour. |
I should probably say that I don't use the REPL buffer all that much, so take my opinion with a grain of salt. :) |
Looking at the code behind |
OK, so |
Background on I would agree with simplifying it away, unless the original concern stands tall. |
This was problematic before and will remain to be problematic now as well. Basically you'll just fallback to the default REPL, which seems reasonable to me. |
One more thing - now all operations are auto-dispatched via the "correct" connection and fallback to the default connection if the connection associated with a project cannot be determined. There's still some room for improvement, but overall people will have to deal with connection switching way less. |
Cool. That was a bit of an elephant in the room in that if Cider knows the 'relevant/correct' connection, then why not always use that info for all operations. It's a pretty big change to make as it's in the core flow. If there's no problems for anyone, then excellent! |
Well, previous the biggest practical issue was that you could not associate a local project with a connection created with |
@jeremyheiler ping |
@bbatsov Sorry for the delay. My son was born shortly after opening this PR. :-) I should have some time this week to fix it up. |
Congrats! |
c8f133f
to
78f2efe
Compare
@bbatsov I've pushed some changes, and rebased on from master. |
Add cider-load-buffer-and-switch-to-repl-buffer
👍 |
@SirSkidmore and I wrote a command
C-c M-z
to abbreviate:Specifically, the function will load (eval) the current buffer, change the namespace of the REPL buffer to match the currently visited source file, and then switch to the relevant REPL buffer.
We thought about parameterizing the the function to selecting the REPL buffer, but that would have to be done before
cider-load-buffer
is invoked, and weren't sure how to handle that. While attempting to do it, the message fromcider-load-buffer
would be in the way unless you know to type something to get rid of it.