From 2bcd7eec677d06db25aee5fe33915e07cf1167d4 Mon Sep 17 00:00:00 2001 From: Rainer Kottenhoff Date: Sat, 25 May 2019 21:11:13 +0200 Subject: [PATCH] + fix: Occurrences Counter --- Versions/build.txt | 2 +- res/Notepad3.exe.manifest.conf | 2 +- src/Edit.c | 22 +++++++++------------- src/VersionEx.h | 2 +- 4 files changed, 12 insertions(+), 16 deletions(-) diff --git a/Versions/build.txt b/Versions/build.txt index a894381fc..ad0b314c2 100644 --- a/Versions/build.txt +++ b/Versions/build.txt @@ -1 +1 @@ -1721 +1722 diff --git a/res/Notepad3.exe.manifest.conf b/res/Notepad3.exe.manifest.conf index 26f06f415..efbe16042 100644 --- a/res/Notepad3.exe.manifest.conf +++ b/res/Notepad3.exe.manifest.conf @@ -3,7 +3,7 @@ Notepad3 RC diff --git a/src/Edit.c b/src/Edit.c index 6df663f20..07ad7ce60 100644 --- a/src/Edit.c +++ b/src/Edit.c @@ -6139,7 +6139,6 @@ void EditMarkAllOccurrences(HWND hwnd, bool bForceClear) if (!IsMarkOccurrencesEnabled()) { EditClearAllOccurrenceMarkers(hwnd); - Globals.iMarkOccurrencesCount = -1; return; } @@ -6450,19 +6449,17 @@ bool EditReplaceAllInSelection(HWND hwnd, LPCEDITFINDREPLACE lpefr, bool bShowIn void EditClearAllOccurrenceMarkers(HWND hwnd) { UNUSED(hwnd); - if (Globals.iMarkOccurrencesCount > 0) - { - Globals.iMarkOccurrencesCount = IsMarkOccurrencesEnabled() ? 0 : -1; - _IGNORE_NOTIFY_CHANGE_; + Globals.iMarkOccurrencesCount = IsMarkOccurrencesEnabled() ? 0 : -1; - SciCall_SetIndicatorCurrent(INDIC_NP3_MARK_OCCURANCE); - SciCall_IndicatorClearRange(0, Sci_GetDocEndPosition()); - SciCall_SetIndicatorCurrent(INDIC_NP3_FOCUS_VIEW); - SciCall_IndicatorClearRange(0, Sci_GetDocEndPosition()); - - _OBSERVE_NOTIFY_CHANGE_; - } + _IGNORE_NOTIFY_CHANGE_; + + SciCall_SetIndicatorCurrent(INDIC_NP3_MARK_OCCURANCE); + SciCall_IndicatorClearRange(0, Sci_GetDocEndPosition()); + SciCall_SetIndicatorCurrent(INDIC_NP3_FOCUS_VIEW); + SciCall_IndicatorClearRange(0, Sci_GetDocEndPosition()); + + _OBSERVE_NOTIFY_CHANGE_; } @@ -6574,7 +6571,6 @@ void EditMarkAll(HWND hwnd, char* pszFind, int flags, DocPos rangeStart, DocPos DocPos start = rangeStart; DocPos end = rangeEnd; - Globals.iMarkOccurrencesCount = 0; DocPos iPos = (DocPos)-1; do { diff --git a/src/VersionEx.h b/src/VersionEx.h index cc2b0de85..b86c8738b 100644 --- a/src/VersionEx.h +++ b/src/VersionEx.h @@ -8,7 +8,7 @@ #define VERSION_MAJOR 5 #define VERSION_MINOR 19 #define VERSION_REV 525 -#define VERSION_BUILD 1721 +#define VERSION_BUILD 1722 #define SCINTILLA_VER 415+ #define ONIGMO_REGEX_VER 6.2.0 #define VERSION_PATCH RC