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));