From ca87fbdea8e3c7e24f4cc6606626dc97015fb331 Mon Sep 17 00:00:00 2001 From: Rainer Kottenhoff Date: Wed, 9 May 2018 09:43:06 +0200 Subject: [PATCH] + fix: clear all occurrences marker on no matching search expression --- src/Edit.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/Edit.c b/src/Edit.c index fdecfc406..f30b4df7f 100644 --- a/src/Edit.c +++ b/src/Edit.c @@ -5280,14 +5280,13 @@ INT_PTR CALLBACK EditFindReplaceDlgProcW(HWND hwnd,UINT umsg,WPARAM wParam,LPARA if (EditToggleView(g_hwndEdit, false)) { _DeleteLineStateAll(LINESTATE_OCCURRENCE_MARK); } StringCchCopyA(g_lastFind, COUNTOF(g_lastFind), sg_pefrData->szFind); RegExResult_t match = _FindHasMatch(g_hwndEdit, sg_pefrData, 0, (sg_pefrData->bMarkOccurences), false); - if (regexMatch != match) { - regexMatch = match; - } + if (regexMatch != match) { regexMatch = match; } // we have to set Sci's regex instance to first find (have substitution in place) DocPos const iStartPos = (DocPos)lParam; _FindHasMatch(g_hwndEdit, sg_pefrData, iStartPos, false, true); sg_pefrData->bStateChanged = false; InvalidateRect(GetDlgItem(hwnd, IDC_FINDTEXT), NULL, true); + if (match != MATCH) { EditClearAllOccurrenceMarkers(g_hwndEdit); } if (EditToggleView(g_hwndEdit, false)) { EditHideNotMarkedLineRange(g_hwndEdit, -1, -1, true); } _OBSERVE_NOTIFY_CHANGE_; }