From d501a9ba0ecae8392e9cbc910a80874b401914a3 Mon Sep 17 00:00:00 2001 From: "David A. Mellis" Date: Wed, 24 Aug 2011 11:35:12 -0400 Subject: [PATCH] Single-click to open a URL / link (rather than double-click). --- app/src/processing/app/syntax/JEditTextArea.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/app/src/processing/app/syntax/JEditTextArea.java b/app/src/processing/app/syntax/JEditTextArea.java index 9683c43d8..3c1548fbd 100644 --- a/app/src/processing/app/syntax/JEditTextArea.java +++ b/app/src/processing/app/syntax/JEditTextArea.java @@ -2106,6 +2106,13 @@ public class JEditTextArea extends JComponent private void doSingleClick(MouseEvent evt, int line, int offset, int dot) { + // Check for click on urls + String clickedURL = checkClickedURL(getLineText(line), offset); + if (clickedURL != null) { + Base.openURL(clickedURL); + return; + } + if ((evt.getModifiers() & InputEvent.SHIFT_MASK) != 0) { rectSelect = (evt.getModifiers() & InputEvent.CTRL_MASK) != 0; select(getMarkPosition(),dot); @@ -2122,13 +2129,6 @@ public class JEditTextArea extends JComponent if (getLineLength(line) == 0) return; - // Check for click on urls - String clickedURL = checkClickedURL(getLineText(line), offset); - if (clickedURL != null) { - Base.openURL(clickedURL); - return; - } - try { int bracket = TextUtilities.findMatchingBracket(document, Math.max(0,dot - 1));