-
-
Notifications
You must be signed in to change notification settings - Fork 297
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
Order of completions #1733
Comments
I also came across this issue today, my use case is that I want to show the most recently updated files at first when listing (e.g. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Background
All mainstream shells allow users to control the order of completions.
Shells that have the option to control order
complete -F _mycmd_completer -o nosort mycmd
/-o nosort
complete -x -k -c mycmd -a "(_mycmd_completer)"
/-k
_describe "" displays values -Q -S '' -o nosort
/-o nosort
Shells that preserve the order of the generated completions
It is necessary to follow this convention in Elvish.
Problem
Elvish doesn't provide an option to control the order of completions, but it automatically sorts completions. That's the problem.
Related issues: #525 #580 #915
Suggestion
Learn from PowerShell/Nushell, don't sort of the generated completions. For built-in completion lists such as filepath, when generating a list, ensure that it is already sorted.
If it is difficult to implement the above requirement due to compatibility or architecture, at least add a
sort
field to the candidate object.The text was updated successfully, but these errors were encountered: