Re: [RFC/PATCH 02/11] ref-filter: add 'colornext' atom
- From
Jacob Keller <jacob.keller@gmail.com>
- Date
- Jul 30, 2015, 04:27 UTC
- Message-ID
- <CA+P7+xpYg4wsJW8JOGHMsDohCUvcD=X-34wcGGvEQM8mEK3dbg@mail.gmail.com>
- In-Reply-To
- <vpqtwsmd53f.fsf@anie.imag.fr>
On Wed, Jul 29, 2015 at 2:30 PM, Matthieu Moy <Matthieu.Moy@grenoble-inp.fr> wrote:
Show 17 quoted lines
> Eric Sunshine <sunshine@sunshineco.com> writes:
>
>> Also, please explain here and in the commit message why this highly
>> specialized colorizer ('colornext'), is needed even though a more
>> general purpose one ('color') is already available.
>
> It is needed in the current form to allow
> %(colornext:blue)%(ifexists:[%s]) to color only the replacement of %s
> and not the [].
>
> But I now think that this would be more elegantly solved by Junio's
> %(if) %(endif) idea:
>
> %(if:atom) [ %(color:blue)%(atom)%(color:reset) ] %(endif)
>
> (I added spaces for clarity)
>I agree, this style seems a lot more elegant and expressive while much easier to understand. Same for doing this to the alignment atoms and such as it solves the same problem(s) there.
I can't speak to how easy it is to implement tho.
Regards, Jake