Issue #1552: fix hanging due to querying TSynMemo.GetTextLen in OnPaintTransient

This commit is contained in:
Ansgar Becker
2022-03-16 19:44:02 +01:00
parent ed9ffbc2b9
commit 3f7edb4904

View File

@ -7395,9 +7395,10 @@ begin
if (MatchingBraceBackgroundColor = clNone) and (MatchingBraceForegroundColor = clNone) then
Exit;
Editor := TSynEdit(Sender);
// Prevent lagging on large contents
if Editor.GetTextLen > 5*SIZE_MB then
Exit;
// Check for Editor.GetTextLen causes some endless loop in SynEdit.
// But not due to activated WordWrap. Must be some interlocked WM_GETTEXTLENGTH message, or an undefined text length.
//if Editor.GetTextLen > 5*SIZE_MB then
// Exit;
// Highlight matching words, if selected text is a (small) word
if Editor.SelLength < Editor.CharsInWindow then begin