From fa51c2af6e3a162ea4c9b26c9c5422b8fffccb62 Mon Sep 17 00:00:00 2001 From: Don HO Date: Wed, 3 Jun 2020 01:57:12 +0200 Subject: [PATCH] Make URL hover foreground colour work again --- PowerEditor/src/Notepad_plus.cpp | 4 ++-- PowerEditor/src/Notepad_plus.h | 1 - PowerEditor/src/ScitillaComponent/ScintillaEditView.cpp | 9 +++++++++ PowerEditor/src/ScitillaComponent/ScintillaEditView.h | 1 + 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/PowerEditor/src/Notepad_plus.cpp b/PowerEditor/src/Notepad_plus.cpp index 918608a92..0909720ca 100644 --- a/PowerEditor/src/Notepad_plus.cpp +++ b/PowerEditor/src/Notepad_plus.cpp @@ -2455,8 +2455,8 @@ void Notepad_plus::addHotSpot(ScintillaEditView* view) ScintillaEditView* pView = view ? view : _pEditView; int urlAction = (NppParameters::getInstance()).getNppGUI()._styleURL; - LPARAM Style = (urlAction == 2) ? INDIC_PLAIN : INDIC_HIDDEN; - pView->execute(SCI_INDICSETSTYLE, URL_INDIC, Style); + LPARAM indicStyle = (urlAction == 2) ? INDIC_PLAIN : INDIC_HIDDEN; + pView->execute(SCI_INDICSETSTYLE, URL_INDIC, indicStyle); pView->execute(SCI_INDICSETHOVERSTYLE, URL_INDIC, INDIC_FULLBOX); int startPos = 0; diff --git a/PowerEditor/src/Notepad_plus.h b/PowerEditor/src/Notepad_plus.h index d966247a0..144373976 100644 --- a/PowerEditor/src/Notepad_plus.h +++ b/PowerEditor/src/Notepad_plus.h @@ -62,7 +62,6 @@ #define TOOLBAR 0x02 #define URL_REG_EXPR "[A-Za-z]+://[A-Za-z0-9_\\-\\+~.:?&@=/%#,;\\{\\}\\(\\)\\[\\]\\|\\*\\!\\\\]+" -#define URL_INDIC 8 enum FileTransferMode { TransferClone = 0x01, diff --git a/PowerEditor/src/ScitillaComponent/ScintillaEditView.cpp b/PowerEditor/src/ScitillaComponent/ScintillaEditView.cpp index 9728a9397..1de04b90b 100644 --- a/PowerEditor/src/ScitillaComponent/ScintillaEditView.cpp +++ b/PowerEditor/src/ScitillaComponent/ScintillaEditView.cpp @@ -2609,6 +2609,15 @@ void ScintillaEditView::performGlobalStyles() execute(SCI_SETFOLDMARGINCOLOUR, true, foldMarginColor); execute(SCI_SETFOLDMARGINHICOLOUR, true, foldMarginHiColor); + COLORREF urlHoveredFG = grey; + i = stylers.getStylerIndexByName(TEXT("URL hovered")); + if (i != -1) + { + Style & style = stylers.getStyler(i); + urlHoveredFG = style._fgColor; + } + execute(SCI_INDICSETHOVERFORE, URL_INDIC, urlHoveredFG); + COLORREF foldfgColor = white, foldbgColor = grey, activeFoldFgColor = red; getFoldColor(foldfgColor, foldbgColor, activeFoldFgColor); diff --git a/PowerEditor/src/ScitillaComponent/ScintillaEditView.h b/PowerEditor/src/ScitillaComponent/ScintillaEditView.h index c554244e8..bf4aca824 100644 --- a/PowerEditor/src/ScitillaComponent/ScintillaEditView.h +++ b/PowerEditor/src/ScitillaComponent/ScintillaEditView.h @@ -187,6 +187,7 @@ struct LanguageName { int lexerID; }; +#define URL_INDIC 8 class ISorter; class ScintillaEditView : public Window