diff options
author | Sopot Cela | 2017-03-01 08:29:58 +0000 |
---|---|---|
committer | Sopot Cela | 2017-03-06 11:42:57 +0000 |
commit | bf2f6f451d18389afe24218d9b08bc5dce79773b (patch) | |
tree | 40b9589b7d0ea8a3def8c891dcb247b22bf84570 | |
parent | 61c4c5b37a2f7150139e41adea50f42e8caa19b2 (diff) | |
download | eclipse.platform.team-bf2f6f451d18389afe24218d9b08bc5dce79773b.tar.gz eclipse.platform.team-bf2f6f451d18389afe24218d9b08bc5dce79773b.tar.xz eclipse.platform.team-bf2f6f451d18389afe24218d9b08bc5dce79773b.zip |
Bug 512856 - Improve highlighting in patch editorY20170309-1000S4_7_0_M6I20170315-0500I20170314-2000I20170313-2000I20170312-2000I20170311-2000I20170310-2000I20170308-2000I20170308-0800I20170307-2000I20170307-0800I20170307-0610I20170307-0450I20170307-0420I20170307-0410I20170307-0150I20170306-2000
Adds bold for visual chunk and diff separation.
Change-Id: Ia7d0ef5e1c6e6d33e4508e7e7673402395b7a2df
Signed-off-by: Sopot Cela <scela@redhat.com>
-rw-r--r-- | bundles/org.eclipse.team.genericeditor.diff.extension/src/org/eclipse/team/internal/genericeditor/diff/extension/presentation/DiffPresentationReconciler.java | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/bundles/org.eclipse.team.genericeditor.diff.extension/src/org/eclipse/team/internal/genericeditor/diff/extension/presentation/DiffPresentationReconciler.java b/bundles/org.eclipse.team.genericeditor.diff.extension/src/org/eclipse/team/internal/genericeditor/diff/extension/presentation/DiffPresentationReconciler.java index 9c27d1c18..f6e74dcd9 100644 --- a/bundles/org.eclipse.team.genericeditor.diff.extension/src/org/eclipse/team/internal/genericeditor/diff/extension/presentation/DiffPresentationReconciler.java +++ b/bundles/org.eclipse.team.genericeditor.diff.extension/src/org/eclipse/team/internal/genericeditor/diff/extension/presentation/DiffPresentationReconciler.java @@ -27,12 +27,16 @@ public class DiffPresentationReconciler extends PresentationReconciler { Display.getCurrent().getSystemColor(SWT.COLOR_RED)); private final TextAttribute bodyAttributePlus = new TextAttribute( Display.getCurrent().getSystemColor(SWT.COLOR_DARK_GREEN)); + private final TextAttribute bodyAttributeMinusBold = new TextAttribute( + Display.getCurrent().getSystemColor(SWT.COLOR_RED), null, SWT.BOLD); + private final TextAttribute bodyAttributePlusBold = new TextAttribute( + Display.getCurrent().getSystemColor(SWT.COLOR_DARK_GREEN), null, SWT.BOLD); private final TextAttribute hunkAttribute = new TextAttribute( - Display.getCurrent().getSystemColor(SWT.COLOR_DARK_BLUE)); + Display.getCurrent().getSystemColor(SWT.COLOR_DARK_BLUE), null, SWT.BOLD); private final TextAttribute headerAttribute = new TextAttribute( Display.getCurrent().getSystemColor(SWT.COLOR_DARK_MAGENTA)); private final TextAttribute indexDiffAttribute = new TextAttribute( - Display.getCurrent().getSystemColor(SWT.COLOR_DARK_CYAN)); + Display.getCurrent().getSystemColor(SWT.COLOR_DARK_CYAN), null, SWT.BOLD); public DiffPresentationReconciler() { @@ -47,13 +51,13 @@ public class DiffPresentationReconciler extends PresentationReconciler { this.setRepairer(hdr, IDiffPartitioning.PARTITION_HEADER); IRule[] bodyRules=new IRule[7]; - bodyRules[0] = new StartOfLineRule("+", null, new Token(bodyAttributePlus));//$NON-NLS-1$ - bodyRules[1] = new StartOfLineRule("-", null, new Token(bodyAttributeMinus));//$NON-NLS-1$ + bodyRules[0]=new StartOfLineRule("---", null, new Token(bodyAttributeMinusBold));//$NON-NLS-1$ + bodyRules[1]=new StartOfLineRule("+++", null, new Token(bodyAttributePlusBold));//$NON-NLS-1$ bodyRules[2] = new StartOfLineRule("@@", null, new Token(hunkAttribute));//$NON-NLS-1$ bodyRules[3]=new StartOfLineRule("diff --git", null, new Token(indexDiffAttribute));//$NON-NLS-1$ bodyRules[4]=new StartOfLineRule("index", null, new Token(indexDiffAttribute));//$NON-NLS-1$ - bodyRules[5]=new StartOfLineRule("---", null, new Token(bodyAttributeMinus));//$NON-NLS-1$ - bodyRules[6]=new StartOfLineRule("+++", null, new Token(bodyAttributePlus));//$NON-NLS-1$ + bodyRules[5] = new StartOfLineRule("+", null, new Token(bodyAttributePlus));//$NON-NLS-1$ + bodyRules[6] = new StartOfLineRule("-", null, new Token(bodyAttributeMinus));//$NON-NLS-1$ RuleBasedScanner scanner = new RuleBasedScanner(); scanner.setRules(bodyRules); DefaultDamagerRepairer dr = new DefaultDamagerRepairer(scanner); |