( )⚙ D4264 zsh_completion: declare appropriate local parameters for ->string form

This is an archive of the discontinued Mercurial Phabricator instance.

zsh_completion: declare appropriate local parameters for ->string form
ClosedPublic

Authored by av6 on Aug 11 2018, 12:09 AM.

Details

Summary

When ->string form is used for _arguments, the function that calls it must
declare appropriate local parameters.

Managing local return value is needed to tell the completion system if our
function succeeded in suggesting something or not, plus without that `hg diff
-<TAB>` doesn't look right.

While at it, fix a copypaste error (s/diff_files/revert_files/).

Docs: http://zsh.sourceforge.net/Doc/Release/Completion-System.html

Diff Detail

Repository
rHG Mercurial
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

av6 created this revision.Aug 11 2018, 12:09 AM
spectral accepted this revision.Aug 13 2018, 2:33 PM
spectral added a subscriber: spectral.

I don't understand this aspect super well, I admit I haven't read the docs you linked to, but I can see why this would be more correct :)

This revision was automatically updated to reflect the committed changes.