Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [PATCH] _git: Complete options and values for -c.
- X-seq: zsh-workers 39930
- From: Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Re: [PATCH] _git: Complete options and values for -c.
- Date: Sun, 13 Nov 2016 00:06:02 +0000
- Dkim-signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= daniel.shahaf.name; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc:x-sasl-enc; s= mesmtp; bh=TLi4dTLssBFa72XntMywvvRrJ7g=; b=h579NlbLeZ7Wwdrc9Vx3F rnVdta1WI3AfXUqFJFrZTcCLme4x5w1IgeRA6iF2qKDAhpCeqEQfYTJonZ6XEKlf +8DHOUMFZrr6l5M/lcUj/OufQvLdZ53RtH5Xz7RI/cyPNApzQwJoKm9T9Ze6jQoL uYr/zpIqkffei75+qGLmKM=
- Dkim-signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc:x-sasl-enc; s= smtpout; bh=TLi4dTLssBFa72XntMywvvRrJ7g=; b=QCi0o5hyMokNmkA1BcO2 gTvmyKtRK3e2UopnyCB824i9AQJv119llAI5u0VEqDm4X0tWCIQdhAD6sUsaluUV 2yWTfe3QgtIQgDuvEYsCUoPoVL2EDvZFmke/wtNAeBWWeM7LlHJtslXVFUZB3RfL 2adpEITjy31SRJigasDJQSk=
- In-reply-to: <1478858354-8147-1-git-send-email-danielsh@fujitsu.shahaf.local2>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <1478858354-8147-1-git-send-email-danielsh@fujitsu.shahaf.local2>
Daniel Shahaf wrote on Fri, Nov 11, 2016 at 09:59:14 +0000:
> This bifurcates _git-config() in order to provide completion for
>
> % git -c <TAB>
> % git -c foo=<TAB>
Interdiff after feedback by Oliver:
diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git
index 8e4b6e6..d5a3cfd 100644
--- a/Completion/Unix/Command/_git
+++ b/Completion/Unix/Command/_git
@@ -7527,9 +7527,14 @@ _git() {
;;
(configuration)
if compset -P 1 '*='; then
- __git_config_value
+ __git_config_value && ret=0
else
- __git_config_option -S =
+ if compset -S '=*'; then
+ __git_config_option
+ compstate[to_end]='' && ret=0 # don't move cursor if we completed just the "foo." in "foo.bar.baz=value"
+ else
+ __git_config_option -S '=' && ret=0
+ fi
fi
;;
esac
Known issue: completing «git -c user.em<CURSOR>=foo» inserts "ail."
(properly) but puts cursor to the right of the dot, rather than to its
left.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author