Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Getting original words after _arguments



On Apr 20,  5:03pm, Felipe Contreras wrote:
}
} > Hmm. The variable named "words" is special to the completion system, and
} > if _arguments modifies it that probably means that later stuff is going
} > to depend on the state in which $words was left.  You may confuse things
} > by stuffing $orig_words back into words.
} 
} I know, I'm not going to usw zsh completion after that point.

I'm sure you aren't, but the mix of user-function and built-in code in
the completion system means that there may be side-effects propagating
up to the caller of your function.  I'm probably being overly paranoid.
 
} > Is there some reason you can't just work on orig_words in the rest of
} > your function?
} 
} It's not my code, it's git.git's bash completion, which uses 'word'.

Aha.  So you're using bashcompinit?  If not, you might want to look at
the _bash_complete function from there.  Also, if there's a shortcoming
in zsh's git completion which is forcing you to use the one from bash, I
think there are a few people on this list who might want details.



Messages sorted by: Reverse Date, Date, Thread, Author