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
fix: copy the description of the option to its alias in completion #2269
fix: copy the description of the option to its alias in completion #2269
Conversation
lib/completion.ts
Outdated
@@ -258,7 +258,9 @@ export class Completion implements CompletionInstance { | |||
if (!this.zshShell) { | |||
completions.push(dashes + key); | |||
} else { | |||
const desc = descs[key] || ''; | |||
const aliasKey = this?.aliases?.[key]?.[0]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what about cases where there are multiple aliases associated with a key? should this be a loop?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, Thank you. Yes, sometimes the this?.aliases?.[key]?.[0]
will be another alias without a description.
I will make it a loop.
@bcoe |
@mshrtsr thank you for the contribution 👌 |
This PR fixes #2268.
I find the original option for the alias and copy its description to the alias.
As a result, the option and its alias are collected together and aligned in the completion.