IDE/Options: Removing code duplication in method TEditorColorOptionsFrame.ColorPreviewMouseUp

This commit is contained in:
n7800 2025-04-16 03:31:32 +05:00
parent e8bebc065b
commit d90342a070

View File

@ -538,17 +538,10 @@ begin
ColorPreview.GetHighlighterAttriAtRowCol(XY, Token, Attri);
if Attri = nil then
Attri := FCurrentHighlighter.WhitespaceAttribute;
if Attri <> nil then begin
NewNode := ColorElementTree.Items.GetFirstNode;
while Assigned(NewNode) do begin
if (NewNode.Data <> nil)
and (TColorSchemeAttribute(NewNode.Data).StoredName = Attri.StoredName) then
break;
NewNode := NewNode.GetNext;
end;
end;
if NewNode <> nil then begin
NewNode.Selected := True;
if Attri <> nil then
begin
SelectNamedColor(Attri.StoredName);
FindCurHighlightElement;
end;
end;