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 completion quote, preposing and target calculation bug #763

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

Conversation

tompng
Copy link
Member

@tompng tompng commented Oct 13, 2024

Reline's completion target calculation has a bug

require 'reline'
Reline.completion_proc = proc { |target, preposing, postposing|
  puts; p(preposing:, target:, postposing:); exit
}
Reline.readline 'prompt> '
prompt> foo"bar[TAB]
{:preposing=>"foo", :target=>"bar", :postposing=>""}

Preposing is foo, target is bar, and " disappears. This bug is a blocker of fixing #444

This pull request:

prompt> foo"bar[TAB]
{:preposing=>"foo\"", :target=>"bar\"", :postposing=>""}

Preposing is foo". Target is bar". Quote that is appended to target is the root cause of #444.

One test that began failing is deleted because readline-ext does not act like the behavior expected in that test.

@tompng tompng force-pushed the fix_completion_preposing_target_calculation branch from 8699364 to 853beb2 Compare October 13, 2024 09:40
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