Repository navigation
Add name defined in readline to completion key bindings C-i C-p C-n - #698
Merged
Merged
Conversation
ima1zumi
reviewed
May 5, 2024
| @vi_waiting_operator_arg = nil | ||
| @completion_journey_state = nil | ||
| @completion_state = CompletionState::NORMAL | ||
| @completion_occurs = false |
Member
There was a problem hiding this comment.
Why is this instance variable initialization no longer necessary?
Member
Author
There was a problem hiding this comment.
The actual scope of @completion_occurs is very narrow. Removing this initialization will represent the narrow scope clearer.
def input_key(key)
@completion_occurs = false # initialize here
calls process_key() or normal_key() # completion might occur
do_something unless @completion_occurs # use it here
# after here, @completion_occurs is no longer necessary.
# maybe we can remove instance variable, but I think it's too much
end| end | ||
| elsif Symbol === key.char and respond_to?(key.char, true) | ||
|
|
||
| if key.char.is_a?(Symbol) |
matzbot
pushed a commit
to ruby/ruby
that referenced
this pull request
May 5, 2024
bindings C-i C-p C-n (ruby/reline#698) ruby/reline@1314787bbb
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request moves hardcoded \C-i \C-p \C-n to line_editor's method. Just like we did it to
completion_journey_up.vi: \C-n is menu-complete. moves completion even if autocomplete is off.
vi: \C-p is menu-complete-backward. moves completion backward even if autocomplete is off.
\C-i is complete. when autocomplete is enabled, it is menu-complete. unless, it is tab complete
shift-tab is completion-journey-up, a bit different from menu-complete-backward (disabled when autocomplete is off)
Naming
Readline can configure
complete,menu-completeandmenu-complete-backward. Uses the same name to make it configurable in irbrc. The oldcompletemethod is renamed toperform_completion.