Sublime Forum

Is there a way to enable highlighting of changes inside lines in the "Merge Tool"?

#1

Is there a way to enable highlighting of changes inside lines in the “Merge Tool”?

If I run:

sublime_merge mergetool /tmp/test1.txt /tmp/test2.txt

The Merge Tool will correctly identify conflicts, but is there a way to have it highlight changes inside lines between test1.txt and test2.txt?

Thanks

0 Likes

#2

Can you clarify what you mean by “highlight changes inside lines between test1.txt and test2.txt”?

In this contrived example:

The highlight shows the conflict, but also what parts of the lines are different on each side and which are not. Do you mean something different than that?

1 Like

#3

Thanks for your response.

Can you try with this file contents:

test1.txt:

some very long line with important additions and removals

test2.txt:

some very long line with important additions TEST and removals

I want it to highlight the word TEST, but it’s not doing it.

Thanks

0 Likes

#4

Hmm indeed in that case it does not. I suspect that is related to the diff algorithm that’s being used in git/by merge wherein the hunk that conflicts is the whole content, and there aren’t any overlaps before and after for it to come up with a contextual diff (as in the example I cobbled together above).

I’m not sure if there’s a way to make this happen for this situation, unfortunately.

0 Likes