-
Notifications
You must be signed in to change notification settings - Fork 83
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 redisplay/insert_text called from pre_input_hook #742
Conversation
lib/reline.rb
Outdated
def self.insert_text(*args, &block) | ||
line_editor.insert_text(*args, &block) | ||
def self.insert_text(text) | ||
line_editor.insert_pasted_text(text) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we address the difference in naming in the future?
Also, could stop taking a block be a breaking change to some users? (I didn't find such usage with either Reline.insert_text
or Readline.insert_text
during a quick search on GH tho)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It won't be a breaking change. line_editor.insert_text(text)
only accepts one String argument.
Passing a block to a method that does not use a block does not raise any error.
naming
Nice catch, I renamed it to insert_multiline_text
It is now used from Reline.insert_text which is not inserting pasted text
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
(ruby/reline#742) * Fix redisplay/insert_text called from pre_input_hook * Rename insert_pasted_text to insert_multiline_text It is now used from Reline.insert_text which is not inserting pasted text ruby/reline@694a540939
(ruby/reline#742) * Fix redisplay/insert_text called from pre_input_hook * Rename insert_pasted_text to insert_multiline_text It is now used from Reline.insert_text which is not inserting pasted text ruby/reline@694a540939
Fix https://bugs.ruby-lang.org/issues/20711
Add test for frequently used pre_input_hook pattern.