Display logical line numbers in DiffEditorPage
commitc78cc18772708ddd8507726ce0fc574cf540c110
authorThomas Wolf <thomas.wolf@paranor.ch>
Mon, 19 Dec 2016 23:42:10 +0000 (20 00:42 +0100)
committerThomas Wolf <thomas.wolf@paranor.ch>
Wed, 28 Dec 2016 13:40:45 +0000 (28 14:40 +0100)
tree2d9c268af8f0eef9c32e9a6f2fe203d7d60cfa9c
parent14f34b4891159b16762adb91fa0b935cef008501
Display logical line numbers in DiffEditorPage

Give the DiffEditorPage a special LineNumberRulerColumn that can
display logical line numbers of the shown hunk lines, corresponding
to the line numbers in changed file versions.

The ruler menu has a toggle action to switch between this logical
display and the normal physical line number display.

* Store the line numbers in the DiffRegions produced by the
  DiffRegionFormatter. Add a CONTEXT DiffRegion.Type to be able to
  number context lines.
* Introduce a LogicalLineNumberProvider.
* Add a LogicalLineNumberRulerColumn that uses such a provider to
  determine line numbers for a diff side.
* Add a composite OldNewLogicalLineNumberRulerColumn that groups two
  such LogicalLineNumberRulerColumns (one for each side) together, and
  that contains the toggling logic for physical/logical line number
  display.

Change-Id: I53394854523d15187c21786ca54370561d84642d
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/commit/DiffRegionFormatterTest.java
org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/UIText.java
org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/DiffDocument.java
org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/DiffEditorPage.java
org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/DiffRegionFormatter.java
org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/DiffViewer.java
org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/ILogicalLineNumberProvider.java [new file with mode: 0644]
org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/LogicalLineNumberProvider.java [new file with mode: 0644]
org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/LogicalLineNumberRulerColumn.java [new file with mode: 0644]
org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/OldNewLogicalLineNumberRulerColumn.java [new file with mode: 0644]
org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/uitext.properties