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
This commit is contained in:
Derick Payne 2026-01-20 22:51:03 +02:00
parent 90c261012e
commit 734aa63117
4 changed files with 9 additions and 1 deletions

View File

@ -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);

View File

@ -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);

View File

@ -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;

View File

@ -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