-
Notifications
You must be signed in to change notification settings - Fork 7
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
Keybinding: Send selected form to REPL #1371
Comments
When a form is selected, both "Send top form to REPL" and "Send form before caret to REPL" will send the selected portion, not the form they would otherwise choose. Does that do what you want? Execute Current Statement is a source of endless confusion, sorry. It's the action that sends what you're editing in the REPL editor to the REPL, i.e. it only works in the context of the REPL editor. Previously it was hard-coded to Ctrl-Enter on Win/Linux and Cmd-Enter on Mac, but people who switched OSes wanted to be able to customise the keybinding so they didn't go crazy. In order to do that I had to expose the action but it's not clear that it's only available in that context. I'll think about whether to rename it to try to make that clearer, or whether it should perhaps execute "Send form before caret to REPL" in a normal editor. The issue is that in the normal editor that key is already bound to another action, and if I make users change the keybinding there so that it doesn't conflict (because they're used to the existing behaviour) that will also change the key they have to use in the REPL to send their forms. Somewhat related to #1225. |
Ahh - that works if you're not on the last form in the file. If you have the last form selected, with the cursor at the end, it doesn't seem to do anything. re: 'Execute Current Statement', I think you did explain that before, but it got me again :) Which reminds me... If you are in the REPL, it seems that if you type a partial command and hit Enter, it sends the partial command to the REPL. For example, say I type this:
... and then hit enter. It sends that line to the REPL, and now I can't edit it anymore. And I have to complete it. Is there a mode that allows for multi-line REPL input? Something that would only send a completed form when I press Enter at the end of the form? |
Ok, played around with this some more... When using 'Send top form' and the form is in the middle of the file, it does the right thing if the cursor is before or after the form. When using 'Send top form' and the form is at the end of the file, it does the right thing if the cursor is before the form, but does nothing if the cursor is after the selected form. When using 'Send form before', this only works if the cursor is at the end of the selection. When the cursor is before the selection, it does nothing. When bound to Cmd+Enter, it also inserts a newline before the selected form, but doesn't send to the REPL. |
Thanks for that investigation, I'll get all that fixed. Re: your question about partial commands - I always forget that people who don't have their parens closed automatically can also be productive members of society :-) So... it used to work as you describe. However there's an ongoing issue with the Cursive REPL when the user wants some input using |
Ahh - that makes more sense. I only recently switched off the automatic brace matching because it was frequently doing the wrong thing and was fairly annoying. I would rather have to close them myself 100% of the time than have to guess what the behavior will be while I'm typing. I don't think this has anything to do with cursive - it seems more like intellij flakiness. FWIW, that request is much lower priority than the other stuff I've been asking for :) |
Ok - I'm interested in any flakiness there, if you have any examples I'd very much like to see them. There are also a surprising number of config items around that so you may be able to fix it with a flag depending on what you were seeing. |
Ok, I think I've fixed everything here, except the
|
Oh, and again, I'm very keen to receive issues about paren-closing weirdness - I definitely want to fix those if possible. |
Awesome! Thanks for the quick fix. I didn't have time yesterday to play around with the parens, but I should be able to make some time today. |
Ok, got one. Say I’m creating a new anonymous fn at the bar: (foo |) If I open a paren after the hash, it doesn’t produce the matching one. Then if I type the closing paren, it thinks I just wanted the original closing paren, so I have to type the closing one twice. HTH -Matt On April 27, 2016 at 2:00:26 AM, Colin Fleming ([email protected]) wrote: Oh, and again, I'm very keen to receive issues about paren-closing weirdness - I definitely want to fix those if possible. — |
Would it be possible to add a keybinding for 'Send selected form to REPL'?
It's somewhat confusing to have to place the cursor before the selection for it to be evaluated. For example:
[:bar (foo 42) :baz]
In this case, with the middle form selected and the cursor after it, I would expect that to be sent to the REPL.
Secondary question: what's 'Execute Current Statement', if not to send it to the REPL? Sometimes it inserts a return before the selected lines, sometimes it replaces them.
The text was updated successfully, but these errors were encountered: