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

Argmatchers should not handle completion for text immediately following -flag: #61

Closed
chrisant996 opened this issue Jan 23, 2021 · 1 comment
Labels
bug Something isn't working

Comments

@chrisant996
Copy link
Owner

chrisant996 commented Jan 23, 2021

Clink 0.4.9 completes net -x:"Tab the same as net Tab. The argmatcher gets confused. The confusion can further be seen where net -x:"config" Tab completes the same as net config Tab and possible completions are server, workstation.

Clink 1.x should:

  1. Not treat -x: (with no following space)` completions as part of the current argmatcher system.
  2. By default allow file completions to occur there.
  3. Have some argmatcher syntax to supply a match generator function attached to a flag (with no following space). Maybe "-x:"+function_name, by overloading the + operator?

(FWIW, probably point 3 will end up superseding point 1, such that technically the argmatcher system does handle -x: completions, but just analyzes the input a little differently.)

@chrisant996 chrisant996 added the bug Something isn't working label Jan 23, 2021
chrisant996 added a commit that referenced this issue Jan 28, 2021
Clink 0.4.9 accidentally interpreted the next part as the next arg
position.  But that's because Clink and Readline got out of sync about
which word was being completed.

Clink 1.x didn't do any completion.  Although that was actually the
intended behavior, I want to strike a balance between compatibility and
reasonable behavior.

So now Clink recognizes the `-x:` flag syntax and does file completion,
and also colors the whole argument as a flag, regardless what follows
the `:` or `=` character.  To generate other matches, a lua script can
register a generator and provide code to handle the case.

This fixes issues #61 and #62.
@chrisant996
Copy link
Owner Author

Fixed by 05d4daa.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant