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

[BUG] Incorrect usage of $PREFIX and $SUFFIX in completion functions



Many completion functions in the Zsh code base use $PREFIX$SUFFIX to get the word to complete on the command line. However, this seems incorrect to me, because it prevents the _prefix completer from functioning correctly for those completion functions.

Shouldn't all completion functions simply use $PREFIX to get the word to complete, since it is the responsibility of the completer function (_complete, _prefix, etc.) to decide whether the character to the right should be considered part of the word to be completed?

Shouldn't _complete do `PREFIX+=$SUFFIX; SUFFIX=` before calling completion functions, since, otherwise, there is no meaningful difference between it and _prefix?

Additionally, if _complete should indeed do `PREFIX+=$SUFFIX; SUFFIX=`, then shouldn't compinit always enable COMPLETE_IN_WORD, since, without it, _prefix is not able to function correctly and _complete should behave the same regardless?



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