[EGIT PATCH] Make SHA-1 selectable using double-click in the commit message viewer.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The default behaviour does not consider a sequence of numbers and letters
to be a word. Installing the DefaultTextDoubleClickStrategy and activating
"plugins" in the textviewer solves the problem.

Signed-off-by: Robin Rosenberg <robin.rosenberg@xxxxxxxxxx>
---
 .../ui/internal/history/CommitMessageViewer.java   |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/history/CommitMessageViewer.java b/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/history/CommitMessageViewer.java
index 76d57bd..d21555c 100644
--- a/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/history/CommitMessageViewer.java
+++ b/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/history/CommitMessageViewer.java
@@ -15,7 +15,9 @@
 import java.util.regex.Pattern;
 
 import org.eclipse.core.runtime.ListenerList;
+import org.eclipse.jface.text.DefaultTextDoubleClickStrategy;
 import org.eclipse.jface.text.Document;
+import org.eclipse.jface.text.IDocument;
 import org.eclipse.jface.text.TextViewer;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.custom.StyleRange;
@@ -98,6 +100,9 @@ public void mouseDown(final MouseEvent e) {
 				}
 			}
 		});
+		setTextDoubleClickStrategy(new DefaultTextDoubleClickStrategy(),
+				IDocument.DEFAULT_CONTENT_TYPE);
+		activatePlugins();
 	}
 
 	void addCommitNavigationListener(final CommitNavigationListener l) {
-- 
1.6.1.rc3.56.gd0306

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux