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

Completer fault #15

Closed
michalpristas opened this issue Nov 13, 2015 · 3 comments
Closed

Completer fault #15

michalpristas opened this issue Nov 13, 2015 · 3 comments
Assignees
Labels

Comments

@michalpristas
Copy link
Contributor

Hi I noticed a malfunction when having PcItems with same prefix
Using this completer:

var completer = readline.NewPrefixCompleter(
        readline.PcItem("simple",
            readline.PcItem("rule",
                readline.PcItem("-name"),
                readline.PcItem("-name2"),
                readline.PcItem("-name23"),
            ),
        ),
    )

A will get following completion tree
.simple
......rule
............-name (as it is common prefix for all)
..................-name-name (this is not so good)
..................-name2
..................-name23

I would look at it on my own but I'm not sure where to look.
it works fine for
var completer = readline.NewPrefixCompleter(
readline.PcItem("simple",
readline.PcItem("rule",
readline.PcItem("-abc"),
readline.PcItem("-def"),
readline.PcItem("-qwe"),
),
),
)

prefix of agrs is not common

@chzyer
Copy link
Owner

chzyer commented Nov 13, 2015

I think it may cause by PrefixCompleter. I will check it later :)

@chzyer chzyer added the bug label Nov 13, 2015
@chzyer chzyer self-assigned this Nov 13, 2015
@michalpristas
Copy link
Contributor Author

thanks a lot

chzyer added a commit that referenced this issue Nov 14, 2015
@chzyer
Copy link
Owner

chzyer commented Nov 14, 2015

@michalpristas Fixed. Please check that commit above.

@chzyer chzyer closed this as completed Nov 14, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants