mirror of
https://github.com/HeidiSQL/HeidiSQL.git
synced 2026-03-13 09:24:25 +08:00
fix: high CPU load and unresponsiveness through SynEdit highlighter when starting to edit large text in popup editor
Refs #2388
This commit is contained in:
@@ -7,7 +7,7 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: HeidiSQL\n"
|
||||
"POT-Creation-Date: 2012-11-05 21:40\n"
|
||||
"PO-Revision-Date: 2026-02-19 18:41+0100\n"
|
||||
"PO-Revision-Date: 2026-02-22 16:29+0100\n"
|
||||
"Last-Translator: Ansgar Becker <anse@heidisql.com>\n"
|
||||
"Language-Team: English (http://www.transifex.com/projects/p/heidisql/language/en/)\n"
|
||||
"Language: en\n"
|
||||
@@ -6648,8 +6648,8 @@ msgstr "Style:"
|
||||
msgid "Error in code formatting: %s"
|
||||
msgstr "Error in code formatting: %s"
|
||||
|
||||
msgid "Auto-disabling wordwrap for large text"
|
||||
msgstr "Auto-disabling wordwrap for large text"
|
||||
msgid "Auto-disabling wordwrap and syntax highlighter for large text"
|
||||
msgstr "Auto-disabling wordwrap and syntax highlighter for large text"
|
||||
|
||||
msgid "%d tab(s) took longer than expected to restore. Closing and reopening these should fix that: %s"
|
||||
msgstr "%d tab(s) took longer than expected to restore. Closing and reopening these should fix that: %s"
|
||||
|
||||
@@ -1224,7 +1224,7 @@ begin
|
||||
if Result then begin
|
||||
FButton.Visible := ButtonVisible;
|
||||
SetBounds(Rect(0, 0, 0, 0));
|
||||
if (Length(FEdit.Text) > SIZE_KB) or (ScanLineBreaks(FEdit.Text) <> lbsNone) then
|
||||
if (Length(FEdit.Text) >= GRIDMAXDATA) or (ScanLineBreaks(FEdit.Text) <> lbsNone) then
|
||||
ButtonClick(FTree)
|
||||
else begin
|
||||
FPanel.Show;
|
||||
|
||||
@@ -141,11 +141,15 @@ begin
|
||||
end;
|
||||
if Assigned(Detected) then
|
||||
SelectLineBreaks(Detected);
|
||||
if (Length(text) > SIZE_MB) then begin
|
||||
MainForm.LogSQL(_('Auto-disabling wordwrap for large text'));
|
||||
if (Length(text) > SIZE_KB*10) then begin
|
||||
MainForm.LogSQL(_('Auto-disabling wordwrap and syntax highlighter for large text'));
|
||||
btnWrap.Enabled := False;
|
||||
comboHighlighter.Enabled := False;
|
||||
btnCustomizeHighlighter.Enabled := False;
|
||||
end else begin
|
||||
btnWrap.Enabled := True;
|
||||
comboHighlighter.Enabled := True;
|
||||
btnCustomizeHighlighter.Enabled := True;
|
||||
end;
|
||||
|
||||
MemoText.Text := text;
|
||||
@@ -379,6 +383,8 @@ var
|
||||
SelStart, SelLength: Integer;
|
||||
begin
|
||||
// Code highlighter selected
|
||||
if not comboHighlighter.Enabled then
|
||||
Exit;
|
||||
SelStart := MemoText.SelStart;
|
||||
SelLength := MemoText.SelEnd - MemoText.SelStart;
|
||||
MemoText.Highlighter := nil;
|
||||
|
||||
Reference in New Issue
Block a user