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

Merged

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
Copy link
Member

@ima1zumi ima1zumi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@ima1zumi ima1zumi merged commit d3ba721 into ruby:master Nov 24, 2024
40 checks passed
@tompng tompng deleted the fix_completion_preposing_target_calculation branch November 24, 2024 16:24
@ima1zumi ima1zumi added the bug Something isn't working label Nov 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

Successfully merging this pull request may close these issues.

2 participants