Skip to content
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

[SR-6861] When editing previous statements in the repl, enter runs the code instead of inserting a newline #4378

Open
TellowKrinkle opened this issue Jan 29, 2018 · 2 comments
Labels
bug Something isn't working LLDB for Swift

Comments

@TellowKrinkle
Copy link

Previous ID SR-6861
Radar rdar://problem/36989793
Original Reporter @TellowKrinkle
Type Bug
Additional Detail from JIRA
Votes 0
Component/s LLDB for Swift
Labels Bug
Assignee None
Priority Medium

md5: 2274cc32671513101f68a18ba5519722

Issue Description:

According to https://developer.apple.com/swift/blog/?id=18, pressing the enter key while editing code in the repl should insert a newline instead of executing the entered code (unless your cursor is at the very end of the function). On the current version of the repl, this is not the case.

To reproduce:

  1. Type a function which takes up multiple lines into the repl

  2. Evaluate the function

  3. Press the up arrow key to go into history, and attempt to add a line in the middle of the function

Expected result: A new line is added in the middle of the function

Actual result: The repl evaluates the function

As it is currently, I can't figure out a way to add lines to functions in the history, any attempt I make to do so results in the function being evaluated instead.

@belkadan
Copy link

@swift-ci create

@swift-ci
Copy link

Comment by Jim Ingham (JIRA)

I agree with this, we need some way to insert a line into multi-line entry text. It's equally annoying that you can't add a line above you in the function you are currently entering.

We should only do this in multi-line mode, since otherwise when you went to fix a single typo on an line you would always have to ^E then return to submit it. Or really, to hit the return, curse a bit, delete the return, go to the end of the line and hit return...

I don't know how easy this will be to actually implement. We're already fighting a bit down and dirty to get editline to do what we already support. But it's definitely worth trying to fix this.

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@shahmishal shahmishal transferred this issue from apple/swift May 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working LLDB for Swift
Projects
None yet
Development

No branches or pull requests

3 participants