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

[FR] <PATH> behaviour inconsistent with non-complgen path completion #46

Open
degnbol opened this issue Mar 25, 2024 · 4 comments
Open

Comments

@degnbol
Copy link

degnbol commented Mar 25, 2024

completes paths in a basic way that isn't identical to path completion for commands where completion isn't made with complgen.
I'm using zsh.
It ignores zstyle settings related to e.g. ignoring case and adding a space after filename completion.

As a side note, I see that _path_files is being called in the code so I tried redefining , e.g. for ignoring case:

<PATH@zsh> ::= {{{ _path_files -M 'm:{[:lower:][:upper:]}={[:upper:][:lower:]}' }}}

The -M flag seems to be ignored. I'm able to have other flags work, e.g. -F for ignoring patterns. This might be an issue with my setup somehow and not related to complgen.

Thanks for the great project btw, I'm playing around with a (very heuristic) help text parser that goes well with this.

@adaszko
Copy link
Owner

adaszko commented Mar 27, 2024

I appreciate reporting! Will definitely take a look as soon as I find some time

@adaszko
Copy link
Owner

adaszko commented Apr 1, 2024

Could you please post the output of complgen version and the minimal .usage file that triggers the behavior? TIA

@degnbol
Copy link
Author

degnbol commented Apr 2, 2024

complgen version
0df6f4d

And simply a file ~/.config/complgen/minimal.usage with contents:
minimal <PATH>;

I just double checked to make sure, and without the file minimal <TAB> completes file ignoring case etc. (default completion for unknown command is filepath, at least in my setup), while placing the file completes it in a case sensitive manner.

Hope this helps, I can provide Zsh configs if needed.

@adaszko
Copy link
Owner

adaszko commented Jun 15, 2024

Hi, sorry for a late reply.

Are you using JIT or AOT mode?

Adding completions under zsh ultimately boils down to calling compadd -A, so it should be respecting all zstyles.

Perhaps you would be willing to contribute a test case for this issue? Tests under e2e/zsh are a starting point JIT/AOT, depending on your context.

Thanks for the great project btw, I'm playing around with a (very heuristic) help text parser that goes well with this.

Take a look at complgen scrape -- I'd be very happy to accept PRs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants