From 642fdb421a1f5e5b42b1ca02aaedf91b961e1781 Mon Sep 17 00:00:00 2001 From: dail8859 Date: Mon, 14 Nov 2016 11:05:13 -0500 Subject: [PATCH] Fix double click after double clicking hotspot Closes #2547, Closes #1259, Closes #2569 --- PowerEditor/src/Notepad_plus.h | 1 - PowerEditor/src/NppNotification.cpp | 12 ++++-------- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/PowerEditor/src/Notepad_plus.h b/PowerEditor/src/Notepad_plus.h index aaf5e2b7f..a7cc78e21 100644 --- a/PowerEditor/src/Notepad_plus.h +++ b/PowerEditor/src/Notepad_plus.h @@ -383,7 +383,6 @@ private: // For hotspot bool _linkTriggered = true; - bool _isHotspotDblClicked = false; bool _isFolding = false; //For Dynamic selection highlight diff --git a/PowerEditor/src/NppNotification.cpp b/PowerEditor/src/NppNotification.cpp index f63c6ea83..2b8feb670 100644 --- a/PowerEditor/src/NppNotification.cpp +++ b/PowerEditor/src/NppNotification.cpp @@ -691,13 +691,6 @@ BOOL Notepad_plus::notify(SCNotification *notification) } } } - else if (_isHotspotDblClicked) - { - auto pos = notifyView->execute(SCI_GETCURRENTPOS); - notifyView->execute(SCI_SETCURRENTPOS, pos); - notifyView->execute(SCI_SETANCHOR, pos); - _isHotspotDblClicked = false; - } break; } @@ -932,10 +925,13 @@ BOOL Notepad_plus::notify(SCNotification *notification) currentWord[lastCharIndex] = '\0'; ::ShellExecute(_pPublicInterface->getHSelf(), TEXT("open"), currentWord, NULL, NULL, SW_SHOW); - _isHotspotDblClicked = true; // Re-set the previous wordChar list notifyView->execute(SCI_SETWORDCHARS, 0, reinterpret_cast(wordChars)); + + // Select the entire link + notifyView->execute(SCI_SETANCHOR, startPos); + notifyView->execute(SCI_SETCURRENTPOS, endPos); } delete[] wordChars;