From 0a209393347a362ada92678c2316721c3a411986 Mon Sep 17 00:00:00 2001 From: Udo Hoffmann Date: Mon, 19 Oct 2020 00:44:11 +0200 Subject: [PATCH] Fix URLs losing the underlines occasionally issue Improve URL update on resize The reason for the effect is, that the addHotSpot calls for resizing are in the WM_SIZE of the application. This works, as long as the size of the whole application changes, but not, when the application size remains constant and only the size of the document window inside the application changes. The solution for this is, to remove the addHotSpot calls from the WM_SIZE of the application and add them to the DocTabView::reSizeTo function instead. Since addHotSpot cannot be called directly from this function, I took the detour over NPPM_INTERNAL_UPDATECLICKABLELINKS. Fix #9032, close #9034 --- PowerEditor/src/NppBigSwitch.cpp | 15 ++++++++++----- PowerEditor/src/ScitillaComponent/DocTabView.cpp | 1 + 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/PowerEditor/src/NppBigSwitch.cpp b/PowerEditor/src/NppBigSwitch.cpp index 209f4853..0bfa4179 100644 --- a/PowerEditor/src/NppBigSwitch.cpp +++ b/PowerEditor/src/NppBigSwitch.cpp @@ -525,9 +525,6 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa _pDocMap->reloadMap(); } - addHotSpot(_pEditView); - addHotSpot(_pNonEditView); - result = TRUE; break; } @@ -2471,8 +2468,16 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa case NPPM_INTERNAL_UPDATECLICKABLELINKS: { - addHotSpot(_pEditView); - addHotSpot(_pNonEditView); + ScintillaEditView* pView = reinterpret_cast(wParam); + if (pView == NULL) + { + addHotSpot(_pEditView); + addHotSpot(_pNonEditView); + } + else + { + addHotSpot(pView); + } } default: diff --git a/PowerEditor/src/ScitillaComponent/DocTabView.cpp b/PowerEditor/src/ScitillaComponent/DocTabView.cpp index f4cf6d45..1a9f1d50 100644 --- a/PowerEditor/src/ScitillaComponent/DocTabView.cpp +++ b/PowerEditor/src/ScitillaComponent/DocTabView.cpp @@ -228,5 +228,6 @@ void DocTabView::reSizeTo(RECT & rc) rc.bottom -= (borderWidth * 2); _pView->reSizeTo(rc); } + SendMessage(_hParent, NPPM_INTERNAL_UPDATECLICKABLELINKS, reinterpret_cast(_pView), 0); }