Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDani Megert2015-06-08 09:33:34 -0400
committerMatthias Sohn2015-06-08 11:23:07 -0400
commit2197b2091b94ad72ef772ca658171d4779ac8574 (patch)
tree087789b83fa1ce5c5da4550c632ff18b64c16b3d
parent293572df4bd82e4911ef9c0b1307658cee593f70 (diff)
downloadegit-2197b2091b94ad72ef772ca658171d4779ac8574.tar.gz
egit-2197b2091b94ad72ef772ca658171d4779ac8574.tar.xz
egit-2197b2091b94ad72ef772ca658171d4779ac8574.zip
Fix broken spell checking in commit message and Staging view
Bug: 428320 Change-Id: I76514be1be4b8bcd1cf7e457416cdd7ada252be5 Signed-off-by: Dani Megert <Daniel_Megert@ch.ibm.com> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/SpellcheckableMessageArea.java23
1 files changed, 21 insertions, 2 deletions
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/SpellcheckableMessageArea.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/SpellcheckableMessageArea.java
index b2db3b005..07572229d 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/SpellcheckableMessageArea.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/SpellcheckableMessageArea.java
@@ -745,8 +745,7 @@ public class SpellcheckableMessageArea extends Composite {
@Override
public void textChanged(TextEvent event) {
- textWidget.setStyleRanges(
- new StyleRange[0]);
+ removeHyperlinkStyleRanges();
UIUtils.applyHyperlinkDetectorStyleRanges(sourceViewer,
configuration.getHyperlinkDetectors(sourceViewer));
if (undoAction != null)
@@ -754,6 +753,26 @@ public class SpellcheckableMessageArea extends Composite {
if (redoAction != null)
redoAction.update();
}
+
+ private void removeHyperlinkStyleRanges() {
+ StyleRange[] hyperlinkStyleRanges = textWidget.getStyleRanges(true);
+ Color blue = Display.getDefault()
+ .getSystemColor(SWT.COLOR_BLUE);
+ Color white = Display.getDefault()
+ .getSystemColor(SWT.COLOR_WHITE);
+ for (int i = 0; i < hyperlinkStyleRanges.length; i++) {
+ StyleRange styleRange = hyperlinkStyleRanges[i];
+ if (styleRange.underline == true
+ && styleRange.foreground == blue
+ && styleRange.background == white) {
+ styleRange = (StyleRange) styleRange.clone();
+ styleRange.background = null;
+ styleRange.foreground = null;
+ styleRange.underline = false;
+ textWidget.setStyleRange(styleRange);
+ }
+ }
+ }
});
// set the cursor when hovering over a link

Back to the top