Re: [PATCH 5/7] diff.c: refactor internal representation for coloring moved code
- From
- Jonathan Tan <jonathantanmy@google.com>
- Date
- Apr 2, 2018, 23:51 UTC
- Message-ID
- <20180402165144.73e701d7816ddfcf00006d95@google.com>
- In-Reply-To
- <20180402224854.86922-6-sbeller@google.com>
On Mon, 2 Apr 2018 15:48:52 -0700 Stefan Beller <sbeller@google.com> wrote:
Show 9 quoted lines
> At the time the move coloring was implemented we thought an enum of modes > is the best to configure this feature. However as we want to tack on new > features, the enum would grow exponentially. > > Refactor the code such that features are enabled via bits. Currently we can > * activate the move detection, > * enable the block detection on top, and > * enable the dimming inside a block, though this could be done without > block detection as well (mode "plain, dimmed")
Firstly, patches 1-4 are obviously correct.
As for this patch, I don't think that using flags is the right way to do this. We are not under any size pressure for struct diff_options, and the additional options that we plan to add (color-moved-whitespace-flags and ignore-space-delta) can easily be additional fields instead.