Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
[PATCH 2/5] bashcompinit: fix COMP_POINT
- X-seq: zsh-workers 30132
- From: Felipe Contreras <felipe.contreras@xxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: [PATCH 2/5] bashcompinit: fix COMP_POINT
- Date: Sat, 28 Jan 2012 18:55:48 +0200
- Cc: Felipe Contreras <felipe.contreras@xxxxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=SoZ2XQNuElZoqwUgb+OvA1eUwRJ7HKErRPULaN/ghlo=; b=v5W7L19obdZXo7q5HNeg25D/oTQ0CdICfEIXrFJT5ymVbqToZjVFlQaWjHIuDXwKpR bnEUYZ4uXIM7u3Y5BHHtSHdFfo4XRZzPJZCqSU321uQ/rrsupDvQNKwR3uNibsJdxIpk JAzKaEEuWGFpfrLYk6OU2lZTfiK827dEEoynM=
- In-reply-to: <1327769751-6806-1-git-send-email-felipe.contreras@gmail.com>
- 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: <1327769751-6806-1-git-send-email-felipe.contreras@gmail.com>
And add a comment explaining how 'words' changes behavior while we are
no it.
Signed-off-by: Felipe Contreras <felipe.contreras@xxxxxxxxx>
---
Completion/bashcompinit | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/Completion/bashcompinit b/Completion/bashcompinit
index 01cc38b..2d6743e 100644
--- a/Completion/bashcompinit
+++ b/Completion/bashcompinit
@@ -8,7 +8,7 @@ _bash_complete() {
local COMP_LINE="$words"
local -A savejobstates savejobtexts
- (( COMP_POINT = 1 + ${#${(j. .)words[1,CURRENT-1]}} + $#QIPREFIX + $#IPREFIX + $#PREFIX ))
+ (( COMP_POINT = 1 + ${#${(j. .)words[1,CURRENT]}} + $#QIPREFIX + $#IPREFIX + $#PREFIX ))
(( COMP_CWORD = CURRENT - 1))
COMP_WORDS=( $words )
BASH_VERSINFO=( 2 05b 0 1 release )
@@ -46,6 +46,7 @@ compgen() {
local -a name res results jids
local -A shortopts
+ # words changes behavior: words[1] -> words[0]
emulate -L sh
setopt kshglob noshglob braceexpand nokshautoload
--
1.7.8.3
Messages sorted by:
Reverse Date,
Date,
Thread,
Author