git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Robin Rosenberg <robin.rosenberg@dewire.com>
Date
Jan 10, 2009, 17:20 UTC
Message-ID
<1231608053-25866-1-git-send-email-robin.rosenberg@dewire.com>

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@dewire.com>
---
 .../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
Message 1 of 1 in “Make SHA-1 selectable using double-click in the commit message viewer.”
  1. Make SHA-1 selectable using double-click in the commit message viewer.Robin Rosenberg, Jan 10, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.