GithubHelp home page GithubHelp logo

When completion proc returns the token it was asked to complete, a space should be added to end of word, and text should not be deleted about rb-readline HOT 11 CLOSED

connoratherton avatar connoratherton commented on August 17, 2024
When completion proc returns the token it was asked to complete, a space should be added to end of word, and text should not be deleted

from rb-readline.

Comments (11)

rocky avatar rocky commented on August 17, 2024

The above issue was modified slightly as I got to understand more precisely the condition under which I get a difference between the C readline and the ruby readline.

from rb-readline.

luislavena avatar luislavena commented on August 17, 2024

Hello,

Excuse my ignorance, but I seems not to understand what you're reporting here.

I've tried against examples/example_readline_with_completion.rb and saw that no space is added after the completion is done.

That is what you're suggesting? That a space is added after a completion method is done?

Sorry I no longer have C Readline available to compare behaviors.

Please let me know.

from rb-readline.

rocky avatar rocky commented on August 17, 2024

If C Readline the prompt has a space added to the end.

In rb-readline there is no space added and I don't think the behavior is changed by setting Readline.completion_append_character to a space.

from rb-readline.

luislavena avatar luislavena commented on August 17, 2024

Sorry, but you lost me again. I'm not understanding if you're talking about the prompt, the autocomplete or what anymore.

from rb-readline.

rocky avatar rocky commented on August 17, 2024

Sorry. I didn't mean the prompt. I meant the Readline.line_buffer or the text that appears after the completion action is performed

Here are some examples assuming the definition of the completion function:
Readline.completion_proc=Proc.new{|args| [args]}

C Readline:

abc<TAB> becomes: abc<SPACE>
<TAB> becomes <SPACE>
abc<SPACE>def<TAB> becomes abc<SPACE>def<SPACE>

rb-readline:

abc<TAB> becomes: abc
<TAB> becomes nothing
abc<SPACE>def<TAB> becomes abc<SPACE>def

from rb-readline.

luislavena avatar luislavena commented on August 17, 2024

Thank you to explain the problem, I finally comprehend it.

I'll investigate later on this but indeed is an implementation mismatch.

from rb-readline.

Spakman avatar Spakman commented on August 17, 2024

I played around with this bug some weeks ago, but didn't get around to submitting a patch.

rocky: this isn't the correct solution, but just so that I'm understanding the problem correctly, does changing line 165 of lib/readline.rb to result.uniq solve the problem for you?

Just to confuse matters a little more, the GNU Readline/standard Ruby Readline varies behaviour in this situation between 1.8.7 and 1.9.2. I can only reproduce the above situation on 1.8.7. Using 1.9.2, the behaviour is more like the current behaviour of rb-readline.

What sort of compatibility are we aiming for? Should rb-readline on 1.8.7 and 1.9.2 vary behaviour to match the corresponding version of Ruby & GNU/C Readline (yuck!)?

from rb-readline.

luislavena avatar luislavena commented on August 17, 2024

Hey guys, can you email me? let's have a email conversation about the project moving forward.

I really would like to introduce your changes, but also build a solid testing infrastructure.

Right now, it lacks it (unit tests are worthless). I was thinking do a childprocess driven specs or features for example, to avoid possible interference by console redirection, and also considering that Windows sucks at console redirection.

I can put the building blocks for it in a few weeks, but perhaps you guys can take a stab first.

Not only introduce the changes but have you both as contributors.

My email is my username at gmail.com

Thank you.

from rb-readline.

Spakman avatar Spakman commented on August 17, 2024

Pull request 45[1] should fix this issue.

Rocky, can you confirm that it works for your case, please?

1 - #45

from rb-readline.

rocky avatar rocky commented on August 17, 2024

I just tried it on the example above

abc<TAB> becomes: abc<SPACE>
<TAB> becomes <SPACE>
abc<SPACE>def<TAB> becomes abc<SPACE>def<SPACE>

and all of this checks out fine.

The problem originally came up in testing completion for the trepanning for rubinius, but I haven't tried it there.

from rb-readline.

Spakman avatar Spakman commented on August 17, 2024

Fixed by #45.

from rb-readline.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.