rdoc icon indicating copy to clipboard operation
rdoc copied to clipboard

Fix ri completion to always return candidates start with a given name

Open tompng opened this issue 1 year ago • 0 comments

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)

tompng avatar Jan 12 '24 15:01 tompng