pcouas
pcouas

Reputation: 41

Notepad++ compare plugin icons signification plus

I compared two text files they are identical for me except line order. Why does Notepad++ give me an green plus and a red minus?

enter image description here

Upvotes: 3

Views: 11018

Answers (1)

Matt Pilz
Matt Pilz

Reputation: 151

The blue highlight attempts to show which lines exist in both documents but have been moved to different lines. This can be disabled by unchecking "Detect Moves" in the compare plugin options.

The red highlights illustrate which lines have been removed and the green highlights illustrate which have been added between the versions.

Although the lines are simply reordered in your example, the compare plugin can't intelligently depict it any other way than what you see. If you disable Detect Moves then it will show the first two lines as deleted on the left and added to the right, since it considers the starting point to be the first line on the right.

The compare plugin does the following:

  1. Sets the document on the right ("base.txt") as the new file for comparing against the document on the left ("deployed.txt"). You can change the order via "Set as First to Compare" option before making the comparison.
  2. Reads the first line of the right file and attempts to find an identical match on the left. Then visually shifts the lines of the right file down so that the first line matches the identical line on the left (line 3).
  3. Attempts to detect obvious line moves as indicated by the double blue arrows, while marking other lines as deleted from old (left) and added to new (right) as described above.

Upvotes: 6

Related Questions