mirror of
https://github.com/rizonesoft/Notepad3.git
synced 2026-06-11 21:03:05 +08:00
+ rev: reverting delayed WaitCursor() call - now depending on some document statistics to prevent displaying "spinning circle"
This commit is contained in:
parent
84755074bc
commit
f4cf622d5a
@ -397,6 +397,7 @@
|
||||
<ClInclude Include="src\EditModel.h" />
|
||||
<ClInclude Include="src\Editor.h" />
|
||||
<ClInclude Include="src\EditView.h" />
|
||||
<ClInclude Include="src\ElapsedPeriod.h" />
|
||||
<ClInclude Include="src\ExternalLexer.h" />
|
||||
<ClInclude Include="src\FontQuality.h" />
|
||||
<ClInclude Include="src\Indicator.h" />
|
||||
|
||||
@ -671,5 +671,8 @@
|
||||
<ClInclude Include="win32\ScintillaWin.h">
|
||||
<Filter>win32</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\ElapsedPeriod.h">
|
||||
<Filter>src</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
19
src/Edit.c
19
src/Edit.c
@ -5977,7 +5977,8 @@ void EditMarkAllOccurrences()
|
||||
}
|
||||
if (EditIsInTargetTransaction()) { return; } // do not block, next event occurs for sure
|
||||
|
||||
BeginWaitCursor(NULL);
|
||||
bool const bWaitCursor = (g_iMarkOccurrencesCount > 4000) ? true : false;
|
||||
if (bWaitCursor) { BeginWaitCursor(NULL); }
|
||||
IgnoreNotifyChangeEvent();
|
||||
EditEnterTargetTransaction();
|
||||
|
||||
@ -6001,7 +6002,7 @@ void EditMarkAllOccurrences()
|
||||
|
||||
EditLeaveTargetTransaction();
|
||||
ObserveNotifyChangeEvent();
|
||||
EndWaitCursor();
|
||||
if (bWaitCursor) { EndWaitCursor(); }
|
||||
}
|
||||
|
||||
|
||||
@ -6265,7 +6266,8 @@ bool EditReplaceAllInSelection(HWND hwnd, LPCEDITFINDREPLACE lpefr, bool bShowIn
|
||||
const DocPos anchorPos = SciCall_GetAnchor();
|
||||
DocPos enlargement = 0;
|
||||
|
||||
BeginWaitCursor(NULL);
|
||||
bool const bWaitCursor = ((end - start) > (512 * 512)) ? true : false;
|
||||
if (bWaitCursor) { BeginWaitCursor(NULL); }
|
||||
IgnoreNotifyChangeEvent();
|
||||
|
||||
int token = BeginUndoAction();
|
||||
@ -6273,7 +6275,7 @@ bool EditReplaceAllInSelection(HWND hwnd, LPCEDITFINDREPLACE lpefr, bool bShowIn
|
||||
iReplacedOccurrences = EditReplaceAllInRange(hwnd, lpefr, start, end, &enlargement);
|
||||
|
||||
ObserveNotifyChangeEvent();
|
||||
EndWaitCursor();
|
||||
if (bWaitCursor) { EndWaitCursor(); }
|
||||
|
||||
if (iReplacedOccurrences <= 0) {
|
||||
EndUndoAction(token);
|
||||
@ -6356,9 +6358,10 @@ bool EditToggleView(HWND hwnd, bool bToggleView)
|
||||
static bool bSaveFoldingAvailable = false;
|
||||
static bool bSaveShowFolding = false;
|
||||
|
||||
if (bToggleView) {
|
||||
|
||||
BeginWaitCursor(NULL);
|
||||
if (bToggleView)
|
||||
{
|
||||
bool const bWaitCursor = ((g_iMarkOccurrencesCount > 1000) || (SciCall_GetLineCount() > 2000)) ? true : false;
|
||||
if (bWaitCursor) { BeginWaitCursor(NULL); }
|
||||
IgnoreNotifyChangeEvent();
|
||||
|
||||
if (!bHideNonMatchedLines) {
|
||||
@ -6388,7 +6391,7 @@ bool EditToggleView(HWND hwnd, bool bToggleView)
|
||||
}
|
||||
|
||||
ObserveNotifyChangeEvent();
|
||||
EndWaitCursor();
|
||||
if (bWaitCursor) { EndWaitCursor(); }
|
||||
}
|
||||
return bHideNonMatchedLines;
|
||||
}
|
||||
|
||||
@ -5785,11 +5785,11 @@ LRESULT MsgNotify(HWND hwnd,WPARAM wParam,LPARAM lParam)
|
||||
MarkAllOccurrences(iUpdateDelayMarkAllCoccurrences);
|
||||
}
|
||||
}
|
||||
// ignoring SC_UPDATE_CONTENT cause Style and Marker are out of scope here
|
||||
// using WM_COMMAND -> SCEN_CHANGE instead!
|
||||
//else if (scn->updated & SC_UPDATE_CONTENT) {
|
||||
// MarkAllOccurrences(iUpdateDelayMarkAllCoccurrences);
|
||||
//}
|
||||
else if (scn->updated & SC_UPDATE_CONTENT) {
|
||||
// ignoring SC_UPDATE_CONTENT cause Style and Marker are out of scope here
|
||||
// using WM_COMMAND -> SCEN_CHANGE instead!
|
||||
//~MarkAllOccurrences(iUpdateDelayMarkAllCoccurrences);
|
||||
}
|
||||
}
|
||||
|
||||
if (g_bHyperlinkHotspot) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user