+ fix: Mark Occurrences: force position progress in case of zero-length matches

This commit is contained in:
Rainer Kottenhoff 2018-01-05 14:20:41 +01:00
parent a5be1a362f
commit b352dd05eb
2 changed files with 7 additions and 7 deletions

View File

@ -5568,16 +5568,19 @@ void EditMarkAll(HWND hwnd, char* pszFind, int flags, int rangeStart, int rangeE
SendMessage(hwnd, SCI_SETINDICATORCURRENT, INDIC_NP3_MARK_OCCURANCE, 0);
int iPos = -1;
do {
++iMarkOccurrencesCount;
int iPos = EditFindInTarget(hwnd, pszText, iFindLength, flags, &start, &end, (end == start));
iPos = EditFindInTarget(hwnd, pszText, iFindLength, flags, &start, &end, (start == iPos));
++iMarkOccurrencesCount; // -1 -> 0
if (iPos < 0)
break; // not found
// mark this match if not done before
if (!SciCall_IndicatorValueAt(INDIC_NP3_MARK_OCCURANCE, iPos)) {
if (!(SciCall_IndicatorValueAt(INDIC_NP3_MARK_OCCURANCE, end) &&
SciCall_IndicatorValueAt(INDIC_NP3_MARK_OCCURANCE, start))) {
SciCall_IndicatorFillRange(iPos, (end - start));
}

View File

@ -5619,10 +5619,6 @@ LRESULT MsgNotify(HWND hwnd,WPARAM wParam,LPARAM lParam)
if (scn->updated & (SC_UPDATE_SELECTION | SC_UPDATE_CONTENT))
{
// !!! SC_UPDATE_CONTENT is triggered very often ,
// even if nothing relevant has been modified
// relevant modifications are handled in SCN_MODIFIED !!!
//~InvalidateSelections(); // fixed in SCI ?
// Brace Match
@ -5631,6 +5627,7 @@ LRESULT MsgNotify(HWND hwnd,WPARAM wParam,LPARAM lParam)
}
if (iMarkOccurrences) {
// clear marks only, if caret/selection changed
if (scn->updated & SC_UPDATE_SELECTION) {
EditClearAllMarks(g_hwndEdit, 0, -1);
}