diff --git a/src/Edit.c b/src/Edit.c index 9620a8a37..137f7ceb2 100644 --- a/src/Edit.c +++ b/src/Edit.c @@ -6528,7 +6528,7 @@ void EditMarkAll(HWND hwnd, char* pszFind, int flags, DocPos rangeStart, DocPos DocPos const iWordStart = SciCall_WordStartPosition(iCurrPos, true); DocPos const iWordEnd = SciCall_WordEndPosition(iCurrPos, true); iFindLength = (iWordEnd - iWordStart); - StringCchCopyNA(pszText, HUGE_BUFFER, SciCall_GetRangePointer(iWordStart, iFindLength), iFindLength); + StringCchCopyNA(txtBuffer, COUNTOF(txtBuffer), SciCall_GetRangePointer(iWordStart, iFindLength), iFindLength); } else { return; // no selection and no word mark chosen diff --git a/src/Notepad3.c b/src/Notepad3.c index a5f2c827f..aa12c38f6 100644 --- a/src/Notepad3.c +++ b/src/Notepad3.c @@ -6627,7 +6627,7 @@ LRESULT MsgNotify(HWND hwnd, WPARAM wParam, LPARAM lParam) // clear marks only, if selection changed if (iUpd & SC_UPDATE_SELECTION) { - if (!SciCall_IsSelectionEmpty()) { + if (!SciCall_IsSelectionEmpty() || Settings.MarkOccurrencesCurrentWord) { MarkAllOccurrences(Settings2.UpdateDelayMarkAllOccurrences, true); } else { @@ -6637,8 +6637,8 @@ LRESULT MsgNotify(HWND hwnd, WPARAM wParam, LPARAM lParam) else if (iUpd & SC_UPDATE_CONTENT) { // ignoring SC_UPDATE_CONTENT cause Style and Marker are out of scope here // using WM_COMMAND -> SCEN_CHANGE instead! - //~~~UpdateVisibleUrlIndics(); //~~~MarkAllOccurrences(Settings2.UpdateDelayMarkAllCoccurrences, false); + //~~~UpdateVisibleUrlIndics(); } } UpdateToolbar();