diff --git a/PowerEditor/src/NppNotification.cpp b/PowerEditor/src/NppNotification.cpp index 7f752c7a8..3fa250d7c 100644 --- a/PowerEditor/src/NppNotification.cpp +++ b/PowerEditor/src/NppNotification.cpp @@ -587,7 +587,7 @@ BOOL Notepad_plus::notify(SCNotification *notification) case SCN_HOTSPOTDOUBLECLICK : { - notifyView->execute(SCI_SETWORDCHARS, 0, (LPARAM)"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-+.:?&@=/%#"); + notifyView->execute(SCI_SETWORDCHARS, 0, (LPARAM)"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-+.,:?&@=/%#()"); int pos = notifyView->execute(SCI_GETCURRENTPOS); int startPos = static_cast(notifyView->execute(SCI_WORDSTARTPOSITION, pos, false)); @@ -611,6 +611,11 @@ BOOL Notepad_plus::notify(SCNotification *notification) notifyView->getGenericText(currentWord, MAX_PATH*2, startPos, endPos); + // This treatment would fail on some valid URLs where there's actually supposed to be a comma or parenthesis at the end. + int lastCharIndex = _tcsnlen(currentWord, MAX_PATH*2) - 1; + if(lastCharIndex >= 0 && (currentWord[lastCharIndex] == ',' || currentWord[lastCharIndex] == ')' || currentWord[lastCharIndex] == '(')) + currentWord[lastCharIndex] = '\0'; + ::ShellExecute(_pPublicInterface->getHSelf(), TEXT("open"), currentWord, NULL, NULL, SW_SHOW); _isHotspotDblClicked = true; notifyView->execute(SCI_SETCHARSDEFAULT);