Fix zsh hanging when tab completing add/checkout

This commit is contained in:
Joshua Cold 2022-05-07 11:51:17 -06:00
parent abf6ea4b61
commit 6d42d803b2
No known key found for this signature in database
GPG Key ID: DCD06942FDA195EF
1 changed files with 13 additions and 0 deletions

View File

@ -7,6 +7,19 @@ zstyle -T ':completion:*:yadm:argument-1:descriptions:' format && \
zstyle -T ':completion:*:yadm:*:yadm' group-name && \
zstyle ':completion:*:yadm:*:yadm' group-name ''
function _yadm-add(){
yadm_path="$(yadm rev-parse --show-toplevel)"
yadm_options=$(yadm status --porcelain=v1 |
awk -v yadm_path=${yadm_path} '{printf "%s/\"%s\"\\:\"%s\" ", yadm_path, $2, $1 }' )
_alternative \
"args:custom arg:(($yadm_options))" \
'files:filename:_files'
}
function _yadm-checkout(){
_yadm-add
}
_yadm-alt() {
return 0
}