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

Refactor nomultiline and multiline mode difference #653

Merged
merged 2 commits into from Apr 17, 2024

Conversation

tompng
Copy link
Member

@tompng tompng commented Mar 19, 2024

We don't need so much if-else branch for multiline mode and nomultiline mode.

This will internally allow multiline input in nomultiline mode. (#641)
Supporting multiline in nomultiline is needed to implement bracketed paste, pasting multiline text into nomultiline mode.

To manually test multiline input in singleline mode

Input multiline input to IRB, to append multiline history

irb(main):001* if 1
irb(main):002*   2
irb(main):003> end

Toggle singleline mode by calling Reline.readline '>> '

irb(main):004> Reline.readline '>> '
>> 

Press up arrow

>> if 1
  2
end

You can try this reproduction step in an older version of Reline, and can see a bug like this

irb(main):004> if 1          █

@tompng tompng marked this pull request as ready for review March 25, 2024 13:55
@ima1zumi ima1zumi added the enhancement New feature or request label Apr 11, 2024
@tompng tompng merged commit 9784609 into ruby:master Apr 17, 2024
40 checks passed
@tompng tompng deleted the simplify_nomultiline_node branch April 17, 2024 16:12
matzbot pushed a commit to ruby/ruby that referenced this pull request Apr 17, 2024
(ruby/reline#653)

* Support multiline input in Reline.readline internally, reduce multiline-singleline branch

* Add readline(singleline) prompt test with force inserting multiline text

ruby/reline@97846095d7
artur-intech pushed a commit to artur-intech/ruby that referenced this pull request Apr 26, 2024
(ruby/reline#653)

* Support multiline input in Reline.readline internally, reduce multiline-singleline branch

* Add readline(singleline) prompt test with force inserting multiline text

ruby/reline@97846095d7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Development

Successfully merging this pull request may close these issues.

None yet

3 participants