-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Decide when the REPL should enter multi-line mode #5183
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
Comments
I asked for this in the JLine mailing list |
Looks like we can just use alt+enter to make a newline so we should just change enter to only check if the input is incomplete. |
You can make this work on the default Mac terminal by going to However this is not enabled by default. Do we want to move forward anyway? |
Yes, I think so, as a fallback we can always implement Ammonite's behavior where you can force multi-line by wrapping your code in |
I played a bit with ammonite and it seems it submit the buffer, only if the cursor is on the last line. I think it makes sense and is a good compromise. Always submitting would make multi-line editing cumbersome |
Sounds reasonable to me |
…ast line ... or input is incomplete.
…he last line ... or input is incomplete.
Fix #5183: (REPL) Only insert line break when cursor is not on the last line
…he last line ... or input is incomplete.
Right now when pressing Enter, the REPL will add a new line instead of running the current input if:
But after experimenting with it, I think that usually when pressing enter in the middle of a line, I expect the input to be run. I suggest adding another shortcut (maybe Shift+Enter, Ctrl+Enter is not technically possible on most terminals) to signify "I want to add a new line and not run this command". (We might also need a shortcut for the opposite problem: "I want to run this command and not add a new line")
The text was updated successfully, but these errors were encountered: