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

Fix incremental search cancel bug #748

Merged
merged 1 commit into from
Oct 2, 2024

Conversation

tompng
Copy link
Member

@tompng tompng commented Sep 8, 2024

Readline restores line, cursor position and history index with "\C-g"(cancel incremental search). Reline should also restore them.
Moving history is difficult. We should use utility method move_history.

Fix incremental search cancel behavior

Input

123\n
456\n
UP
LFET
\C-r
12
\C-g

Expected (Readline, this branch)

irb(main):001> 123
=> 123
irb(main):002> 456
=> 456
irb(main):003> 45|6

Actual

irb(main):001> 123
=> 123
irb(main):002> 456
=> 456
irb(main):003> |123

Fix irb crash

input

1\n
\C-r
1
TAB
\C-r
1
TAB

bug

reline/line_editor.rb:1712:in 'block in Reline::LineEditor#incremental_search_history': undefined method 'split' for nil (NoMethodError)
@buffer_of_lines = line.split("\n")

Copy link
Member

@ima1zumi ima1zumi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your refactoring and bugfix!

@ima1zumi ima1zumi merged commit bf0f8fa into ruby:master Oct 2, 2024
40 checks passed
@tompng tompng deleted the reverse_search_bugfix branch October 2, 2024 18:19
@ima1zumi ima1zumi added the bug Something isn't working label Nov 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

Successfully merging this pull request may close these issues.

2 participants