From 734aa63117ebae73bf65cd3ce8fd9ff1dd1db757 Mon Sep 17 00:00:00 2001 From: Derick Payne Date: Tue, 20 Jan 2026 22:51:03 +0200 Subject: [PATCH] fix: Persist Monitoring Log (View -> Monitoring Log) setting Added MonitoringLog bool to Settings struct and implemented load/save in Config.cpp. The setting is now restored from INI file on startup and saved when settings are saved. Changes: - TypeDefs.h: Added MonitoringLog to SETTINGS_T struct - Config.cpp: Added GET_BOOL_VALUE_FROM_INISECTION for loading - Config.cpp: Added SAVE_VALUE_IF_NOT_EQ_DEFAULT for saving - Notepad3.c: Initialize FileWatching.MonitoringLog from Settings Fixes #5037 --- src/Config/Config.cpp | 3 +++ src/Notepad3.c | 3 +++ src/TypeDefs.h | 1 + todo/TODO.md | 3 ++- 4 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/Config/Config.cpp b/src/Config/Config.cpp index c1b294dc5..2a10f2c39 100644 --- a/src/Config/Config.cpp +++ b/src/Config/Config.cpp @@ -1726,6 +1726,7 @@ void LoadSettings() GET_BOOL_VALUE_FROM_INISECTION(SaveBeforeRunningTools, false); GET_BOOL_VALUE_FROM_INISECTION(EvalTinyExprOnSelection, true); GET_BOOL_VALUE_FROM_INISECTION(ResetFileWatching, true); + GET_BOOL_VALUE_FROM_INISECTION(MonitoringLog, false); // View -> Monitoring Log - fixes #5037 GET_INT_VALUE_FROM_INISECTION(EscFunction, 0, 0, 2); GET_BOOL_VALUE_FROM_INISECTION(AlwaysOnTop, false); if (Globals.CmdLnFlag_AlwaysOnTop) { Settings.AlwaysOnTop = (Globals.CmdLnFlag_AlwaysOnTop == 2); } @@ -2148,6 +2149,8 @@ static bool _SaveSettings(bool bForceSaveSettings) if (bForceSaveSettings) { Settings.FileWatchingMode = FileWatching.FileWatchingMode; } SAVE_VALUE_IF_NOT_EQ_DEFAULT(Int, FileWatchingMode); SAVE_VALUE_IF_NOT_EQ_DEFAULT(Bool, ResetFileWatching); + if (bForceSaveSettings) { Settings.MonitoringLog = FileWatching.MonitoringLog; } // fixes #5037 + SAVE_VALUE_IF_NOT_EQ_DEFAULT(Bool, MonitoringLog); SAVE_VALUE_IF_NOT_EQ_DEFAULT(Int, AutoSaveInterval); SAVE_VALUE_IF_NOT_EQ_DEFAULT(Int, AutoSaveOptions); diff --git a/src/Notepad3.c b/src/Notepad3.c index f70db7d6d..f3c06f2d9 100644 --- a/src/Notepad3.c +++ b/src/Notepad3.c @@ -1947,6 +1947,9 @@ HWND InitInstance(const HINSTANCE hInstance, int nCmdShow) break; } + // Restore saved Monitoring Log setting - fixes #5037 + FileWatching.MonitoringLog = Settings.MonitoringLog; + // initial set text in front of ShowWindow() EditSetNewText(Globals.hwndEdit, "", 0, false, false); diff --git a/src/TypeDefs.h b/src/TypeDefs.h index 2092748cd..2576f7c4f 100644 --- a/src/TypeDefs.h +++ b/src/TypeDefs.h @@ -643,6 +643,7 @@ typedef struct SETTINGS_T { bool EvalTinyExprOnSelection; FILE_WATCHING_MODE FileWatchingMode; bool ResetFileWatching; + bool MonitoringLog; // View -> Monitoring Log setting - fixes #5037 int EscFunction; bool AlwaysOnTop; bool MinimizeToTray; diff --git a/todo/TODO.md b/todo/TODO.md index 6c170f4d2..5e9a426b5 100644 --- a/todo/TODO.md +++ b/todo/TODO.md @@ -39,8 +39,9 @@ - Old bug from v5.21 - needs verification - [ ] **(Q2) BUG: Minipath options don't save** - FullRowSelect/TrackSelect broken - Issue: [#4116](https://github.com/rizonesoft/Notepad3/issues/4116) -- [ ] **(Q1) BUG: Monitoring log not saved** - Setting not persisted +- [x] **(Q1) BUG: Monitoring log not saved** - ✅ FIXED - Issue: [#5037](https://github.com/rizonesoft/Notepad3/issues/5037) + - Fix: Added `MonitoringLog` to Settings struct with INI load/save in Config.cpp - [ ] **(Q3) BUG: LAN file freeze** - Freezes when network host offline - Issue: [#5050](https://github.com/rizonesoft/Notepad3/issues/5050) - [ ] **(Q1) BUG: Find/Replace patterns not updating** - Dropdown not refreshed immediately