Re: [PATCH 2/3] completion: extract completing ctags symbol names into helper function

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Mar 23, 2017 at 04:38:38PM +0100, SZEDER Gábor wrote:

> The previous commit doubled the number of __git_match_ctag()'s
> positional parameters, and, to keep the position of existing
> parameters for the sake of backwards compatibility, the prefix,
> current word and suffix parameters ended up in different order than in
> other functions accepting the same parameters.  Then there is a
> condition checking the existence of the tag file before invoking this
> function.
> 
> We could still live with this if there were only a single callsite,
> but the next commit will add a few more, so it's worth providing a
> cleaner interface.
> 
> Add the wrapper function __git_complete_symbol(), which encompasses
> the condition for checking the presence of the tag file and filling
> COMPREPLY, and accepts '--opt=val'-style options with default values
> that keep callsites simpler.

Nice cleanup. The resulting code in _git_grep() is much more readable.

I use the same completion for "vim -t". Now I can cheat and switch it to
__git_complete_symbol. :)

-Peff



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]