-
-
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
:select nil in popup-rules for cider REPL buffer causes error on cider-jack-in-cljs #2515
Comments
I suppose this is caused by setting the variable (setq cider-default-cljs-repl 'figwheel) |
Nope, still happening |
Maybe the value is overwritten in .dir-locals.el? |
Nope, sorry. Fwiw before setting this I was getting prompted for the cljs repl type to use |
Just tried nerfing my entire |
Been tracing through this with edebug trying to narrow down the problem, and think I may have gotten something. |
|
More narrowing down -- looks like the call to
|
After reading the source, that makes sense - there are other functions in the caller that rely on the current buffer being correct, so when the Without digging too deep into why diff --git a/cider-repl.el b/cider-repl.el
index 261b5bbb..db1cd3f7 100644
--- a/cider-repl.el
+++ b/cider-repl.el
@@ -315,7 +315,10 @@ client process connection. Unless NO-BANNER is non-nil, insert a banner."
(when cider-repl-display-in-current-window
(add-to-list 'same-window-buffer-names (buffer-name buffer)))
(pcase cider-repl-pop-to-buffer-on-connect
- (`display-only (display-buffer buffer))
+ (`display-only
+ (let ((orig-buffer (current-buffer)))
+ (display-buffer buffer)
+ (set-buffer orig-buffer)))
((pred identity) (pop-to-buffer buffer)))
(cider-repl-set-initial-ns buffer)
(cider-repl-require-repl-utils) |
Just commenting that I ran into this as well and @glittershark's patch fixed it for me too. We do share a lot of config (doom-based emacs) but fwiw. |
Can you check if this was maybe fixed with #2484? |
It wasn't, directly, but the update I ran did fix it via another means - specifically doomemacs/doomemacs#1012, which resolves what was causing the call to I think I'm going to submit the above patch as a PR anyway, since it generally makes Cider more robust against these sorts of settings. |
If the user has `:select nil` in their popup rules for the Cider REPL buffer, the call to `display-buffer` to display the repl buffer while initializing it will reset the `current-buffer` to the buffer the user ran `jack-in` from, which breaks any successive calls to `cider-current-repl`. Resetting the current buffer back to the original buffer after `display-buffer` is resilient against this config change, without breaking anything else in the case the config is absent.
Expected behavior
cider-jack-in-cljs
andcider-jack-in-clj&cljs
both launch a repl, then launch figwheel as a siblingActual behavior
If I'm in a cljs file and I run either of the above, I get the following messages:
Followed by the following error:
Steps to reproduce the problem
I can reproduce this on a fresh project created with the
lein-re-frame
template:Open any cljs buffer in the resulting project, and run
M-x cider-jack-in-cljs RET fighweel RET
Note that I have tried the troubleshooting tips mentioned by #1390 (eg reinstalling cider), and that didn't appear to help
Environment & Version information
CIDER 0.19.0snapshot
CIDER version information
Lein version
Emacs version
26.1
Operating system
Arch Linux
The text was updated successfully, but these errors were encountered: