Skip to content

Suggestion: More Precise Coloring Options #99

@kahagerman

Description

@kahagerman

My Use Case

(Since it's a bit hard to describe what I'm looking for without context.)

At a high level, I simply want my eyes to be naturally drawn to the relevant parts of modified lines.

When looking at a diff, I want changed lines to be highlighted green/red as usual.

However, for "modified" lines (i.e. lines which are not added or removed in full) I want to put more emphases on the specific parts of the line that have changed.
Sort of "double-highlighting", first highlighted green/red because the line is added/removed, then highlighted even more because this part of the line is what actually changed.

However, I don't want this "double-highlighting" to apply to new or removed lines, only modified lines.

Currently Targetable --color Faces:

Currently there are two main color pallets which can be customized:

  1. added/removed, which applies to entire lines, and
  2. refine-added/refine-removed, which applies to any added or removed text (within either a modified line or fully added/removed line).

refined-added and refined-removed are currently applied to completely added or completely removed lines.

For my use case above, it's not currently possible to target changed sections within changed lines, without affecting purely added/removed lines.

Proposal

I suggest the following two targetable --color faces:

  • unchanged-added and unchanged-removed - for the parts of modified lines which are not changed, and
  • only-added and only-removed - for lines which are added/removed in full.

With these, it would be possible to separate full-line changes from changes withing lines, and color each individually.

And for purely backwards-compatibility reasons:

  • unchanged-added/unchanged-removed should inherit from added/removed, and
  • only-added/only-removed should inherit from refine-added/refine-removed.

If all options were specified, then added/removed would only apply to the +/- at the start of each line (and probably leading whitespace).

(One more note: I've described everything above as added/removed vs changed lines, but it may be more appropriate to implement this on changed blocks instead.)

Thoughts?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions