rdoc
rdoc copied to clipboard
Fix ri completion to always return candidates start with a given name
Fixes https://bugs.ruby-lang.org/issues/20171
RDoc has a test code like this
assert_equal %w[Foo#Bar Foo::bar], @driver.complete('Foo.')
Reline doesn't accept this completion list because it does not start from 'Foo.'
To make it work with Reline, completion_proc should always return a list of string that starts with the given completion_target text.
This will also fix this weird behavior in Ruby 3.2 using readline
>> Array.t[TAB]
↓
>> Array
(tab complete deletes text)