Zsh gh completion: Show PRs in descending order

This is a bit of a hack - rather than configuring the order properly,
which I can't figure out how to do properly, I'm just setting the zstyle
at the start, then resetting it at the end
This commit is contained in:
Adin Klotz 2020-08-20 21:12:30 -04:00
parent a3af763f46
commit 768e4e835d
1 changed files with 5 additions and 0 deletions

View File

@ -305,6 +305,9 @@ function _gh_issue_view {
function _gh_pr { function _gh_pr {
local -a commands local -a commands
zstyle -s ':completion:*:*:gh:argument-1:' sort oldsort # Save the sort setting
zstyle ':completion:*:*:gh:argument-1:' sort false
_arguments -C \ _arguments -C \
'(-R --repo)'{-R,--repo}'[Select another repository using the `OWNER/REPO` format]:' \ '(-R --repo)'{-R,--repo}'[Select another repository using the `OWNER/REPO` format]:' \
'--help[Show help for command]' \ '--help[Show help for command]' \
@ -365,6 +368,8 @@ function _gh_pr {
_gh_pr_view _gh_pr_view
;; ;;
esac esac
zstyle ':completion:*:*:gh:argument-1:' sort $oldsort # Restore the sort setting
} }
function __pr_numbers { function __pr_numbers {