Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
[PATCH] [RFC] _git: fix __git_ignore_line to ignore the current word
- X-seq: zsh-workers 42364
- From: Daniel Hahler <genml+zsh-workers@xxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: [PATCH] [RFC] _git: fix __git_ignore_line to ignore the current word
- Date: Wed, 14 Feb 2018 01:29:05 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/simple; d=thequod.de; h= x-mailer:message-id:date:date:subject:subject:from:from:received :received:received; s=postfix2; t=1518568148; bh=IjoHYGUZ/SdDE9x BKG50CtU9W2ZFjRe4bFmbE6L7/Rg=; b=q9Co3v2A2+XYDg60RYVPczgaAkzxDHy 51n/eMZruqTphfaSvOLkU0JM4wA/i+1ZIVp29PV5dbFv2PY4iRyBgULCFtb7gcIL gUnFjf1YDuykbSvidZ69m+ST/R7PhCBr4pZCMFammZ//7Wj7gtsHqRBtaTfMuzeA a+B4IZhvhKpk=
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- List-unsubscribe: <mailto:zsh-workers-unsubscribe@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
From: Daniel Hahler <git@xxxxxxxxxx>
Before this patch "git branch -d master<tab>" would result in
"no matches found", while "master" itself should get completed here.
The "(bQ)" (added in 527badc23, via 38129?!) does not seem to be necessary
anymore: with files "f\[a-z\]o" and "foo", "git add f[a-z]o <tab>"
offers "f\[a-z\]o", but not "foo".
---
Completion/Unix/Command/_git | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)
diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git
index 9f0225fab..4df851c98 100644
--- a/Completion/Unix/Command/_git
+++ b/Completion/Unix/Command/_git
@@ -5596,12 +5596,7 @@ __git_describe_commit () {
# .
(( $+functions[__git_ignore_line] )) ||
__git_ignore_line () {
- declare -a ignored
- ignored=()
- ((CURRENT > 1)) &&
- ignored+=(${(bQ)line[1,CURRENT-1]})
- ((CURRENT < $#line)) &&
- ignored+=(${(bQ)line[CURRENT+1,-1]})
+ local -a ignored=(${line:#${words[CURRENT]}})
$* -F ignored
}
--
2.16.1
Messages sorted by:
Reverse Date,
Date,
Thread,
Author