Re: [RFC/PATCH] builtin/blame: darken redundant line information
- From
Stefan Beller <sbeller@google.com>
- Date
- Jun 13, 2017, 18:00 UTC
- Message-ID
- <CAGZ79kakSt8bYr7E9gnNPSVFafyD9G+VUAU+hBBJnX+r_TH=Ag@mail.gmail.com>
- In-Reply-To
- <xmqq37b37p9o.fsf@gitster.mtv.corp.google.com>
On Tue, Jun 13, 2017 at 10:48 AM, Junio C Hamano <gitster@pobox.com> wrote:
Show 15 quoted lines
> > I never said "start and end" (you did). I just wanted the boundary > of A and B and C clear, so I'd be perfectly happy with: > > context > +A dim > +A dim > +A highlight #1 > +C highlight #2 > +B highlight #1 > +B dim > +B dim > context > > You can do that still with only two highlight colors, no?
So to put it into an algorithm:
1) detect blocks 2) if blocks are adjacent, their bounds are eligible for highlighting 3) the highlighting is implemented using the "alternate" strategy in that any line highlighted belonging to a different block flips the highlighting, such that:
context
+A dim
+A dim
+A highlight #1
+B highlight #2
+B dim
+B dim
contextSo if we go this way, we would need indeed 6 colors:
Dimmed, Highlighted, HighlightedAlternative
color-moved modes: nobounds:: uses dimmed only allbounds:: adjacentbounds:: See algorithm above, using dimmed for inside the block and both highlights for bounds, making sure adjacent block bounds alternate the highlighting color. alternate:: Uses only highlighting colors, complete block is colored with one of the highlights
I think that is reasonable to implement. But I do still wonder if we really want to add so many new colors. I'll give it a try after my next submodule series.
Thanks, Stefan