Skip to content

Fix completion quote, preposing and target calculation bug - #763

Merged
ima1zumi merged 1 commit into
ruby:masterfrom
tompng:fix_completion_preposing_target_calculation
Nov 24, 2024
Merged

ima1zumi merged 1 commit into
ruby:masterfrom
tompng:fix_completion_preposing_target_calculation

Conversation

@tompng

@tompng tompng commented Oct 13, 2024

Copy link
Copy Markdown
Member

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

@ima1zumi ima1zumi left a comment

Copy link
Copy Markdown
Member

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
@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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants