-
-
Notifications
You must be signed in to change notification settings - Fork 327
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
Allow multi-line editing in REPL #718
Comments
Is it linked with #2666? |
Yes indeed. Having this implemented would be a significant improvement in repl UX. |
We use rustyline for generic repl features. This rustyline example adapted for |
Yes, I tried it before, but while this works rl.bind_sequence(
KeyEvent(KeyCode::Char('s'), Modifiers::CTRL),
EventHandler::Simple(Cmd::Newline),
); This is handled by the default rl.bind_sequence(
KeyEvent(KeyCode::Enter, Modifiers::SHIFT),
EventHandler::Simple(Cmd::Newline),
); |
Oh I see, can you file an issue for that on the rustyline repo? |
Thanks @ghigt! |
His response makes sens, do you think about an alternative? |
Interesting, |
I don't want to enter into a battle 😇, but I associate I would associate a newline with |
The main thing I like about |
@Anton-4 recommend this be closed as completed. Just using enter on an expression that isn't complete seems to work fine. % roc repl
The rockin’ roc repl
────────────────────────
Enter an expression, or :help, or :q to quit.
» greeting : Str
… greeting = "Hi"
"Hi" : Str # greeting
» |
Thanks for notifying me @lukewilliamboswell :) |
Some languages have multi-line editing using some special symbols to indicate another line is going to follow.
Others detect if what is entered is a parseble expression or statement, this could be a pain to implement.
My personal preference goes to
Shift+Enter
, which is commonly used to go to the next line without submitting when using text-areas.I'll ask in the chat before implementing.
The text was updated successfully, but these errors were encountered: