From 9f41b18165ebdfcdd0f82c80fa4f646ca9f4ccd1 Mon Sep 17 00:00:00 2001 From: Rainer Kottenhoff Date: Sat, 27 Apr 2019 15:55:10 +0200 Subject: [PATCH] + fix: repair Hyperlink styling, broken by last commit --- Versions/build.txt | 2 +- res/Notepad3.exe.manifest.conf | 2 +- src/Notepad3.c | 10 ++++++++-- src/Notepad3.h | 2 +- src/Styles.c | 1 + src/VersionEx.h | 2 +- 6 files changed, 13 insertions(+), 6 deletions(-) diff --git a/Versions/build.txt b/Versions/build.txt index 89fd6869c..9b5365173 100644 --- a/Versions/build.txt +++ b/Versions/build.txt @@ -1 +1 @@ -1676 +1677 diff --git a/res/Notepad3.exe.manifest.conf b/res/Notepad3.exe.manifest.conf index 77c2ea7c9..47451ea2c 100644 --- a/res/Notepad3.exe.manifest.conf +++ b/res/Notepad3.exe.manifest.conf @@ -3,7 +3,7 @@ Notepad3 develop diff --git a/src/Notepad3.c b/src/Notepad3.c index b7263a24c..6cac92cab 100644 --- a/src/Notepad3.c +++ b/src/Notepad3.c @@ -260,6 +260,8 @@ void ObserveNotifyChangeEvent() InterlockedDecrement(&iNotifyChangeStackCounter); } if (CheckNotifyChangeEvent()) { + EditApplyVisibleStyle(); + //~!recursion!~EditUpdateVisibleUrlHotspot(Settings.HyperlinkHotspot); UpdateAllBars(false); } } @@ -1322,6 +1324,7 @@ LRESULT CALLBACK MainWndProc(HWND hwnd, UINT umsg, WPARAM wParam, LPARAM lParam) // update Scintilla colors case WM_SYSCOLORCHANGE: + Sci_ApplyStyle(0, -1); MarkAllOccurrences(0, true); UpdateVisibleUrlHotspot(0); UpdateAllBars(false); @@ -2276,6 +2279,7 @@ LRESULT MsgDPIChanged(HWND hwnd, WPARAM wParam, LPARAM lParam) SendWMSize(hwnd, rc); UpdateUI(); + Sci_ApplyStyle(0, -1); UpdateAllBars(false); return 0; @@ -2343,6 +2347,7 @@ LRESULT MsgThemeChanged(HWND hwnd, WPARAM wParam ,LPARAM lParam) EditUpdateUrlHotspots(Globals.hwndEdit, 0, -1, Settings.HyperlinkHotspot); UpdateUI(); + Sci_ApplyStyle(0, -1); UpdateAllBars(false); return 0; @@ -9197,7 +9202,7 @@ void UpdateUI() scn.nmhdr.hwndFrom = Globals.hwndEdit; scn.nmhdr.idFrom = IDC_EDIT; scn.nmhdr.code = SCN_UPDATEUI; - scn.updated = (SC_UPDATE_CONTENT | SC_UPDATE_NP3_INTERNAL_NOTIFY); + scn.updated = (SC_UPDATE_CONTENT/* | SC_UPDATE_NP3_INTERNAL_NOTIFY */); SendMessage(Globals.hwndMain, WM_NOTIFY, IDC_EDIT, (LPARAM)&scn); //PostMessage(Globals.hwndMain, WM_NOTIFY, IDC_EDIT, (LPARAM)&scn); Sci_ApplyStyle(0, -1); @@ -9759,8 +9764,9 @@ bool FileLoad(bool bDontSave, bool bNew, bool bReload, //bReadOnly = false; _SetSaveNeededFlag(false); + Sci_ApplyStyle(0, -1); UpdateVisibleUrlHotspot(0); - UpdateAllBars(false); + UpdateAllBars(true); // consistent settings file handling (if loaded in editor) s_bEnableSaveSettings = (StringCchCompareNIW(Globals.CurrentFile, COUNTOF(Globals.CurrentFile), Globals.IniFile, COUNTOF(Globals.IniFile)) == 0) ? false : true; diff --git a/src/Notepad3.h b/src/Notepad3.h index e18d95684..d81cb8efa 100644 --- a/src/Notepad3.h +++ b/src/Notepad3.h @@ -144,7 +144,7 @@ void UpdateStatusbar(bool); void UpdateMarginWidth(); void UpdateSettingsCmds(); void UpdateVisibleUrlHotspot(int delay); -inline void UpdateAllBars(bool force) { UpdateToolbar(); UpdateStatusbar(force); UpdateMarginWidth(); Sci_ApplyStyle(0,-1); } +inline void UpdateAllBars(bool force) { UpdateToolbar(); UpdateStatusbar(force); UpdateMarginWidth(); } void UndoRedoRecordingStart(); void UndoRedoRecordingStop(); diff --git a/src/Styles.c b/src/Styles.c index 2f45fa5fe..81c560563 100644 --- a/src/Styles.c +++ b/src/Styles.c @@ -1310,6 +1310,7 @@ void Style_SetLexer(HWND hwnd, PEDITLEXER pLexNew) Style_SetInvisible(hwnd, false); // set fixed invisible style // apply lexer styles + Sci_ApplyStyle(0, -1); Style_SetUrlHotSpot(hwnd, Settings.HyperlinkHotspot); EditUpdateUrlHotspots(hwnd, 0, -1, Settings.HyperlinkHotspot); diff --git a/src/VersionEx.h b/src/VersionEx.h index 5c7e31656..b58e5a67f 100644 --- a/src/VersionEx.h +++ b/src/VersionEx.h @@ -8,7 +8,7 @@ #define VERSION_MAJOR 5 #define VERSION_MINOR 19 #define VERSION_REV 427 -#define VERSION_BUILD 1676 +#define VERSION_BUILD 1677 #define SCINTILLA_VER 415 #define ONIGMO_REGEX_VER 6.2.0 #define VERSION_PATCH develop