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

added keep order to bash, zsh, pwsh & fish #1903

Merged
merged 10 commits into from
Feb 25, 2023
Prev Previous commit
Next Next commit
added a comment
  • Loading branch information
h4ck3rk3y committed Feb 13, 2023
commit fcd84a98d16af70fcd249c27f99ae8690adab443
9 changes: 7 additions & 2 deletions bash_completionsV2.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,13 @@ __%[1]s_process_completion_results() {
fi
if (((directive & shellCompDirectiveKeepOrder) != 0)); then
if [[ $(type -t compopt) == builtin ]]; then
__%[1]s_debug "Activating keep order"
compopt -o nosort
# no sort isn't supported for bash less than < 4.4
if [[ ${BASH_VERSINFO[0]} -lt 4 || ( ${BASH_VERSINFO[0]} -eq 4 && ${BASH_VERSINFO[1]} -lt 4 ) ]]; then
__%[1]s_debug "No sort directive not supported in this version of bash"
else
__%[1]s_debug "Activating keep order"
compopt -o nosort
fi
else
__%[1]s_debug "No sort directive not supported in this version of bash"
fi
Expand Down