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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant