a4424dfefd68e4d23badb2f86087184f9e06fab4

Author
Lukas Grimm <ombre@ombre.ch>
Committer
GitHub <noreply@github.com>
Date

Message

fix(pass): completion for multiple repositories (#12464)

Diff

 1diff --git a/plugins/pass/_pass b/plugins/pass/_pass
 2index d911e122fb81a7736c941f0b48f83b7025f9fcde..c66d9931824ef85dd7d137fd11c09b7bd654d849 100644
 3--- a/plugins/pass/_pass
 4+++ b/plugins/pass/_pass
 5@@ -20,6 +20,8 @@
 6 
 7 _pass () {
 8 	local cmd
 9+  local rootcontext
10+  rootcontext=$curcontext
11 	if (( CURRENT > 2)); then
12 		cmd=${words[2]}
13 		# Set the context for the subcommand.
14@@ -123,8 +125,9 @@ _pass_cmd_show () {
15 _pass_complete_entries_helper () {
16 	local IFS=$'\n'
17 	local prefix
18-	zstyle -s ":completion:${curcontext}:" prefix prefix || prefix="${PASSWORD_STORE_DIR:-$HOME/.password-store}"
19-	_values -C 'passwords' ${$(find -L "$prefix" \( -name .git -o -name .gpg-id \) -prune -o $@ -print 2>/dev/null | sed -e "s#${prefix}/\{0,1\}##" -e 's#\.gpg##' -e 's#\\#\\\\#g' -e 's#:#\\:#g' | sort):-""}
20+	zstyle -s ":completion:${rootcontext}:" prefix prefix ||
21+prefix="${PASSWORD_STORE_DIR:-$HOME/.password-store}"
22+  _values -C 'passwords' ${$(find -L "$prefix" \( -name .git -o -name .gpg-id \) -prune -o $@ -print 2>/dev/null | sed -e "s#${prefix}/\{0,1\}##" -e 's#\.gpg##' -e 's#\\#\\\\#g' -e 's#:#\\:#g' | sort):-""}
23 }
24 
25 _pass_complete_entries_with_subdirs () {