-
Notifications
You must be signed in to change notification settings - Fork 87
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
Update Reline core to stay in sync with the line_editor's completion_append_character #756
Comments
Some configurations are hard to make stay in sync. def new_proc(a)
->k{
Readline.completion_proc = new_proc(a.succ)
Readline.basic_word_break_characters = [';', '.'].sample
[a]
}
end
Readline.completion_proc = new_proc('a') This configurations looks stayed in sync in GNU Readline but not in Reline. Only changing completion_append_character to be synchronized is not so hard, but I think it is not a good idea to guarantee it to be stay in sync. In my opinion, it feel like changing completion_append_character inside completion_proc is a hack that only works in the current version of GNU Readline. |
What would be a more idiomatic Reline solution? For our use case - the scenario is: Some of our completions require a different value for It looks like currently GNU Readline and RbReadline support this functionality, but it's not supported by Reline unfortunately without a patch to sync the Readline and line_editor values As a feature request - if there was a different API to tell Reline about individual append characters as part of the |
I think this is From GNU Readline's documentation https://tiswww.case.edu/php/chet/readline/readline.html#index-rl_005fcompletion_005fappend_005fcharacter
rl_completion_append_character can only be set from completion function and always reset to default value before completion function is called. |
Description
When updating
Reline.completion_append_character
inReline.completion_proc
, the change does not get reflected until you enter a newReline.readline
orReline.readmultiline
context. It seems like the value ofReline.completion_append_character
andReline.line_editor.completion_append_character
is out of sync.Scenario: We are updating the value of
Reline.completion_append_character = ' '
inside of thecompletion_proc
, but it's not reflecting in the line_editorExpected Behaviour
Being able to change
Reline.completion_append_character
in the completion proc and have it update theline_editor
.i.e. this code:
reline/lib/reline.rb
Lines 83 to 93 in 7534f7f
To immediately update the line_editor's
completion_append_character
valueCurrent Behaviour
Changing
Reline.completion_append_character
inReline.completion_append_character
does not take effect until a new call toReline.readline
.Terminal Emulator
MacOS
Reline Version
0.5.10
The text was updated successfully, but these errors were encountered: