From 1142e2dedb628352bb6a45f58fed0fd29b0725a9 Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Wed, 14 Feb 2018 01:18:59 +0100 Subject: 42364: _git: fix __git_ignore_line to ignore the current word Before this patch "git branch -d master" 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 " offers "f\[a-z\]o", but not "foo". --- Completion/Unix/Command/_git | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'Completion/Unix/Command/_git') 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 } -- cgit 1.4.1