1
0
Fork 0
mirror of synced 2024-12-04 14:45:36 -05:00

Fix zsh hanging when tab completing add/checkout

This commit is contained in:
Joshua Cold 2022-05-07 11:51:17 -06:00 committed by Tim Byrne
parent abf6ea4b61
commit beb83077d8
No known key found for this signature in database
GPG key ID: 14DB4FC2465A4B12

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
}