From b1c05d464747a2abf6d1a195224a0c4a104a134c Mon Sep 17 00:00:00 2001 From: Pairi Daiza Date: Thu, 23 Sep 2021 17:10:16 +0200 Subject: [PATCH 1/3] + Upd: Version files and Changes.txt --- Build/Changes.txt | 13 +++++++------ Versions/day.txt | 2 +- res/Notepad3.exe.manifest.conf | 2 +- src/VersionEx.h | 2 +- 4 files changed, 10 insertions(+), 9 deletions(-) diff --git a/Build/Changes.txt b/Build/Changes.txt index 31844e47d..782cf5319 100644 --- a/Build/Changes.txt +++ b/Build/Changes.txt @@ -33,7 +33,7 @@ UCD - (UCD)ARDET is an Encoding Detector Library ======================================================== -Current BETA/RC Version 5.21.916.(build_#) (2021-09-16) +Current BETA/RC Version 5.21.923.(build_#) (2021-09-23) ======================================================== -------------------------------------------------------- @@ -46,16 +46,17 @@ NEW: CHANGES: -------------------------------------------------------- [.###.#]- . -[.916.1]- Use "round nearest displayed digit" method for estimated file size display +[.923.1]- Add context menu for Menubar. +[.916.1]- Use "round nearest displayed digit" method for estimated file size display. [.915.1]- Limit file size: 2GB (Until WideCharToMultiByte() / MultiByteToWideChar() INT32_MAX issues are clarified). -------------------------------------------------------- CHANGES Versions in Tools or Libraries: -------------------------------------------------------- -[.726.1]- Update grepWinNP3 (GRE) version 2.1.8.39 (2021-07-26). -[.702.5]- Update Oniguruma Regex (ONI) engine version 7.0.0 (2021-06-23). [.802.1]- Update Lexilla Library (LEX) version 5.1.2 (2021-07-26). [.726.1]- Update Scintilla Library (SCI) version 5.1.1 (2021-07-26). +[.726.1]- Update grepWinNP3 (GRE) version 2.1.8.39 (2021-07-26). +[.702.5]- Update Oniguruma Regex (ONI) engine version 7.0.0 (2021-06-23). -------------------------------------------------------- FIXES: @@ -215,10 +216,10 @@ CHANGES: -------------------------------------------------------- CHANGES Versions in Tools or Libraries: -------------------------------------------------------- -[.726.1]- Update grepWinNP3 (GRE) version 2.1.8.39 (2021-07-26). -[.702.5]- Update Oniguruma Regex (ONI) engine version 7.0.0 (2021-06-23). [.802.1]- Update Lexilla Library (LEX) version 5.1.2 (2021-07-26). [.726.1]- Update Scintilla Library (SCI) version 5.1.1 (2021-07-26). +[.726.1]- Update grepWinNP3 (GRE) version 2.1.8.39 (2021-07-26). +[.702.5]- Update Oniguruma Regex (ONI) engine version 7.0.0 (2021-06-23). -------------------------------------------------------- FIXES: diff --git a/Versions/day.txt b/Versions/day.txt index f0a9f26fc..209fc0eb4 100644 --- a/Versions/day.txt +++ b/Versions/day.txt @@ -1 +1 @@ -916 +923 diff --git a/res/Notepad3.exe.manifest.conf b/res/Notepad3.exe.manifest.conf index 6738040d0..ba2553567 100644 --- a/res/Notepad3.exe.manifest.conf +++ b/res/Notepad3.exe.manifest.conf @@ -3,7 +3,7 @@ Notepad3 beta diff --git a/src/VersionEx.h b/src/VersionEx.h index 51a1ad6c8..388d7aefc 100644 --- a/src/VersionEx.h +++ b/src/VersionEx.h @@ -8,7 +8,7 @@ #define SAPPNAME "Notepad3" #define VERSION_MAJOR 5 #define VERSION_MINOR 21 -#define VERSION_REV 916 +#define VERSION_REV 923 #define VERSION_BUILD 1 #define SCINTILLA_VER 511 #define LEXILLA_VER 511 From f7b5fc923c2015b19d5931829c220f9381e487b5 Mon Sep 17 00:00:00 2001 From: Pairi Daiza Date: Thu, 23 Sep 2021 18:33:20 +0200 Subject: [PATCH 2/3] + Upd: Version files and Changes.txt --- Build/Changes.txt | 3 ++- Versions/build.txt | 2 +- res/Notepad3.exe.manifest.conf | 2 +- src/VersionEx.h | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Build/Changes.txt b/Build/Changes.txt index 782cf5319..544b97803 100644 --- a/Build/Changes.txt +++ b/Build/Changes.txt @@ -46,7 +46,8 @@ NEW: CHANGES: -------------------------------------------------------- [.###.#]- . -[.923.1]- Add context menu for Menubar. +[.923.2]- Enable context menu for Statusbar. +[.923.1]- Enable context menu for Menubar. [.916.1]- Use "round nearest displayed digit" method for estimated file size display. [.915.1]- Limit file size: 2GB (Until WideCharToMultiByte() / MultiByteToWideChar() INT32_MAX issues are clarified). diff --git a/Versions/build.txt b/Versions/build.txt index d00491fd7..0cfbf0888 100644 --- a/Versions/build.txt +++ b/Versions/build.txt @@ -1 +1 @@ -1 +2 diff --git a/res/Notepad3.exe.manifest.conf b/res/Notepad3.exe.manifest.conf index ba2553567..6ec1c23d0 100644 --- a/res/Notepad3.exe.manifest.conf +++ b/res/Notepad3.exe.manifest.conf @@ -3,7 +3,7 @@ Notepad3 beta diff --git a/src/VersionEx.h b/src/VersionEx.h index 388d7aefc..5827b6c46 100644 --- a/src/VersionEx.h +++ b/src/VersionEx.h @@ -9,7 +9,7 @@ #define VERSION_MAJOR 5 #define VERSION_MINOR 21 #define VERSION_REV 923 -#define VERSION_BUILD 1 +#define VERSION_BUILD 2 #define SCINTILLA_VER 511 #define LEXILLA_VER 511 #define ONIGURUMA_REGEX_VER 7.0.0 From ad85d0b090a6dca87d6f91421d2740ac77b56e33 Mon Sep 17 00:00:00 2001 From: "METANEOCORTEX\\Kotti" Date: Fri, 24 Sep 2021 10:19:08 +0200 Subject: [PATCH 3/3] +chg: Disable file change polling - rely on directory change notification by default +chg: allow [Settings2] "FileCheckInverval" to be zero(0), means no active file change polling +chg: remove deprecated "AutoReloadTimeout" --- Build/Notepad3.ini | 3 +-- src/Config/Config.cpp | 15 +++++++++++---- src/Notepad3.c | 32 ++++++++++++-------------------- src/TypeDefs.h | 5 ++--- 4 files changed, 26 insertions(+), 29 deletions(-) diff --git a/Build/Notepad3.ini b/Build/Notepad3.ini index e4be2901c..415144e21 100644 --- a/Build/Notepad3.ini +++ b/Build/Notepad3.ini @@ -5,7 +5,6 @@ SettingsVersion=5 [Settings2] ;IMEInteraction=0 -;AutoReloadTimeout=2000 ;DateTimeFormat= (-> ) ;DateTimeLongFormat= (-> ) ;TimeStampRegEx= (-> \$Date:[^\$]+\$ ) (Find-Pattern to Update Stamps) @@ -16,7 +15,7 @@ SettingsVersion=5 ;DenyVirtualSpaceAccess=0 ;filebrowser.exe=minipath.exe ;grepWin.exe=grepWinNP3.exe -;FileCheckInverval=2000 +;FileCheckInverval=0 ;FileChangedIndicator=[@] ;FileDeletedIndicator=[X] ;FileDlgFilters= diff --git a/src/Config/Config.cpp b/src/Config/Config.cpp index b82268c31..eee7da9e7 100644 --- a/src/Config/Config.cpp +++ b/src/Config/Config.cpp @@ -1138,10 +1138,16 @@ void LoadSettings() IniSectionGetStringNoQuotes(IniSecSettings2, L"FileDlgFilters", L"", Settings2.FileDlgFilters, COUNTOF(Settings2.FileDlgFilters) - 2); - Settings2.FileCheckInverval = clampul(IniSectionGetInt(IniSecSettings2, L"FileCheckInverval", 2000UL), 250UL, 300000UL); - - Settings2.AutoReloadTimeout = clampul(IniSectionGetInt(IniSecSettings2, L"AutoReloadTimeout", 2000UL), 250UL, 300000UL); - FileWatching.AutoReloadTimeout = Settings2.AutoReloadTimeout; + Settings2.FileCheckInverval = clampul(IniSectionGetInt(IniSecSettings2, L"FileCheckInverval", 0), 0, 86400000<<2); // max: 48h + // handle deprecated old "AutoReloadTimeout" + int const autoReload = IniSectionGetInt(IniSecSettings2, L"AutoReloadTimeout", -1); // deprecated + unsigned int const fci = max_u(250, (autoReload > 0) ? max_u(autoReload, Settings2.FileCheckInverval) : Settings2.FileCheckInverval); + if ((Settings2.FileCheckInverval > 0) && (fci != Settings2.FileCheckInverval)) { + Settings2.FileCheckInverval = fci; + IniSectionSetInt(IniSecSettings2, L"FileCheckInverval", Settings2.FileCheckInverval); + bDirtyFlag = true; + } + FileWatching.FileCheckInverval = Settings2.FileCheckInverval; IniSectionGetString(IniSecSettings2, L"FileChangedIndicator", L"[@]", Settings2.FileChangedIndicator, COUNTOF(Settings2.FileChangedIndicator)); @@ -1988,6 +1994,7 @@ static bool _SaveSettings(bool bForceSaveSettings) // --- remove deprecated --- IniSectionDelete(IniSecSettings2, L"MarkOccurrencesMaxCount", false); + IniSectionDelete(IniSecSettings2, L"AutoReloadTimeout", false); // -------------------------------------------------------------------------- diff --git a/src/Notepad3.c b/src/Notepad3.c index 3b9beb51d..e0bca3967 100644 --- a/src/Notepad3.c +++ b/src/Notepad3.c @@ -5699,12 +5699,12 @@ LRESULT MsgCommand(HWND hwnd, UINT umsg, WPARAM wParam, LPARAM lParam) SendWMCommand(hwnd, IDM_FILE_REVERT); _saveChgNotify = FileWatching.FileWatchingMode; FileWatching.FileWatchingMode = FWM_AUTORELOAD; - FileWatching.AutoReloadTimeout = 250UL; + FileWatching.FileCheckInverval = 250UL; UndoRedoRecordingStop(); SciCall_SetEndAtLastLine(false); } else { FileWatching.FileWatchingMode = _saveChgNotify; - FileWatching.AutoReloadTimeout = Settings2.AutoReloadTimeout; + FileWatching.FileCheckInverval = Settings2.FileCheckInverval; UndoRedoRecordingStart(); SciCall_SetEndAtLastLine(!Settings.ScrollPastEOF); } @@ -11452,7 +11452,8 @@ static inline void NotifyIfFileHasChanged(const bool forcedNotify) { } // ---------------------------------------------------------------------------- - +// FWM_MSGBOX (polling: FileWatching.FileCheckInverval) +// FWM_AUTORELOAD (also FileWatching.MonitoringLog) static void CALLBACK WatchTimerProc(HWND hwnd, UINT uMsg, UINT_PTR idEvent, DWORD dwTime) { UNREFERENCED_PARAMETER(dwTime); @@ -11462,23 +11463,9 @@ static void CALLBACK WatchTimerProc(HWND hwnd, UINT uMsg, UINT_PTR idEvent, DWOR DWORD const diff = GetTickCount() - s_dwFileChangeNotifyTime; - //if (HasDirChanged()) { - // ResetEventDirChanged(); - // NotifyIfFileHasChanged(false); - //} else + // Directory-Observer is not notified for continously updated (log-)files if (diff > Settings2.FileCheckInverval) { - // FWM_MSGBOX (polling: FileWatching.FileCheckInverval) - // Directory-Observer is not notified for continously updated (log-)files - NotifyIfFileHasChanged(false); - } else if (diff > FileWatching.AutoReloadTimeout) { - // FWM_AUTORELOAD (also FileWatching.MonitoringLog) - if (FileWatching.MonitoringLog) { - // monitoring: reload only on change - NotifyIfFileHasChanged(false); - } else { - // unconditional reload - NotifyIfFileHasChanged(false); - } + NotifyIfFileHasChanged(/*FileWatching.MonitoringLog*/ false); } } // ---------------------------------------------------------------------------- @@ -11616,7 +11603,12 @@ void InstallFileWatching(const bool bInstall) { } s_dwFileChangeNotifyTime = (FileWatching.FileWatchingMode == FWM_AUTORELOAD) ? GetTickCount() : 0UL; - SetTimer(Globals.hwndMain, ID_WATCHTIMER, min_dw(Settings2.FileCheckInverval, FileWatching.AutoReloadTimeout), WatchTimerProc); + if (FileWatching.FileCheckInverval > 0) { + SetTimer(Globals.hwndMain, ID_WATCHTIMER, FileWatching.FileCheckInverval, WatchTimerProc); + } + else { + KillTimer(Globals.hwndMain, ID_WATCHTIMER); + } } else if (bExclusiveLock) { diff --git a/src/TypeDefs.h b/src/TypeDefs.h index a6f63cf8b..2cd86d589 100644 --- a/src/TypeDefs.h +++ b/src/TypeDefs.h @@ -612,7 +612,6 @@ typedef struct _settings2_t int OpacityLevel; int FindReplaceOpacityLevel; DWORD FileCheckInverval; - DWORD AutoReloadTimeout; DWORD UndoTransactionTimeout; int IMEInteraction; int SciFontQuality; @@ -699,8 +698,8 @@ typedef struct _filewatching_t { FILE_WATCHING_MODE flagChangeNotify; // <-> s_flagChangeNotify; FILE_WATCHING_MODE FileWatchingMode; // <-> Settings.FileWatchingMode; - DWORD AutoReloadTimeout; // <-> Settings2.AutoReloadTimeout; - bool MonitoringLog; + DWORD FileCheckInverval; // <-> Settings2.FileCheckInverval; + bool MonitoringLog; } FILEWATCHING_T, *PFILEWATCHING_T;