IDE: Optimize "UpdateEditorCommands" - do not join all text lines (TStrings.Text) of the editor, just to check if the editor is empty.

This commit is contained in:
Martin 2022-04-01 00:04:51 +02:00
parent 9f3623bb45
commit f390d81d79

View File

@ -3957,7 +3957,9 @@ begin
IDECommandList.FindIDECommand(ecCut).Enabled := SelEditable;
IDECommandList.FindIDECommand(ecCopy).Enabled := SelAvail;
IDECommandList.FindIDECommand(ecPaste).Enabled := Editable;
IDECommandList.FindIDECommand(ecSelectAll).Enabled := Assigned(ASrcEdit) and (ASrcEdit.SourceText<>'');
IDECommandList.FindIDECommand(ecSelectAll).Enabled := Assigned(ASrcEdit) and
((ASrcEdit.LineCount>1) or ((ASrcEdit.LineCount=1) and (ASrcEdit.Lines[0] <> '')));
end;
IDECommandList.FindIDECommand(ecMultiPaste).Enabled := Editable;