0

Context

I am modifying a big project in Java. In a file, I make some modification to the code (maybe inadvertently). The file is marked with a little * close to the name (that means it is still not saved).

Question

How to find where the new characters were just written?

I know I can use ctrl+z to undo the changes and, thus, find the place where the changes were made. What I am looking for is a way of highlighting the new part in the existing code.

Leos313
  • 5,152
  • 6
  • 40
  • 69
  • 1
    are you using git? – Kasper H Feb 06 '19 at 11:23
  • 2
    try git? in all seriousness, is "right click" -> "compare with" -> "local history" what you are looking for? – rmalchow Feb 06 '19 at 11:23
  • 2
    Possible duplicate of [Highlighting modified lines in Eclipse](https://stackoverflow.com/questions/2447146/highlighting-modified-lines-in-eclipse) – John Feb 06 '19 at 11:24
  • 2
    How about [Quick diff](http://help.eclipse.org/kepler/index.jsp?topic=%2Forg.eclipse.platform.doc.user%2Ftasks%2Ftasks-cvs-quickdiff.htm) or *Ctrl+Q* (for last edit location)? – ernest_k Feb 06 '19 at 11:27
  • the git solution works as well! – Leos313 Feb 06 '19 at 13:32

1 Answers1

1

Eclipse already shows this information by default. Every unsaved change is marked on the left line number ruler.

Deleted lines are marked with an horizontal line "-".
Added/changed lines are marked with a different color of the line number.

enter image description here

Sebastian
  • 1,642
  • 13
  • 26