Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge Horizontal Line Highlighting Color #93

Open
rbong opened this issue Jan 26, 2023 · 0 comments
Open

Merge Horizontal Line Highlighting Color #93

rbong opened this issue Jan 26, 2023 · 0 comments
Labels
help wanted Extra attention is needed

Comments

@rbong
Copy link
Owner

rbong commented Jan 26, 2023

Ideal solution

Ideally, horizontal merge line highlighting would be based on the position of the previous commit.

Ex. if the previous commit fell on an orange branch, the horizontal lines in the merge visual representation would also be orange.

This would correctly show the color of the branch that any parent commits are being merged into - this is valuable information.

Current implementation

Instead of being colored based on the previous commit, right now, horizontal merge lines are colored based on the first merge character from left to right.

├─┊─╮
^ THIS IS THE FIRST MERGE CHARACTER - HORIZONTAL LINES PAST THIS WILL BE COLORED BASED ON THIS BRANCH COLOR

This will not always be the previous commit.

This will also not be the oldest branch, or the newest branch. Branches are placed arbitrarily based on where there is room.

The result is that horizontal merge lines are colored based on some branch involved in the merge.

This is not ideal because it shows arbitrary information on the merge line. However, this information is sometimes helpful or can be used to help visually parse the branch structure, as long as you are aware of the limitations of this method.

Ideal implementation and limitations

We could, theoretically, implement the ideal solution this way.

  V COMMIT CHARACTER - START A SYNTAX REGION THAT SAVES THE COLOR OF THE BRANCH
│ • 
├─┤ < COLOR HORIZONTAL MERGE LINES ON THIS BRANCH ACCORDING TO REGION
• │ 
^ ANOTHER COMMIT CHARACTER - LOOK AHEAD AND END THE REGION AT THE BEGINNING OF THE LINE

This works - but currently, for even fairly short multi-line commits, Vim has trouble keeping track of the current region and everything ends up being drawn white.

Non-solutions

  • Manually setting the highlight color of merge lines is non-performant.
  • I would prefer not to start injecting hidden characters into the output.

Call for help

If anyone is able to implement the region-based, ideal situation without losing the color over multiple lines, help is appreciated.

@rbong rbong added the help wanted Extra attention is needed label Jan 26, 2023
@rbong rbong changed the title Merge Branch Highlighting Color Merge Horizontal Line Highlighting Color Jan 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant