mirror of
https://github.com/HeidiSQL/HeidiSQL.git
synced 2025-08-26 03:01:07 +08:00
Issue #8: show current highlighter colors as "Current custom settings" preset, in preferences dialog
This commit is contained in:
@ -744,14 +744,17 @@ procedure Toptionsform.comboEditorColorsPresetChange(Sender: TObject);
|
||||
var
|
||||
i, j: Integer;
|
||||
Highlighter: TSynSQLSyn;
|
||||
FoundHighlighter: Boolean;
|
||||
begin
|
||||
// Color preset selected
|
||||
FoundHighlighter := False;
|
||||
for i:=0 to ComponentCount-1 do begin
|
||||
if (Components[i] is TSynSQLSyn)
|
||||
and (Components[i] <> SynMemoSQLSample.Highlighter)
|
||||
then begin
|
||||
Highlighter := Components[i] as TSynSQLSyn;
|
||||
if SynRegExpr.ExecRegExpr('[a-zA-Z]+_'+comboEditorColorsPreset.Text, Highlighter.Name) then begin
|
||||
FoundHighlighter := True;
|
||||
for j:=0 to SynSQLSynSQLSample.AttrCount - 1 do begin
|
||||
SynSQLSynSQLSample.Attribute[j].AssignColorAndStyle(Highlighter.Attribute[j]);
|
||||
end;
|
||||
@ -764,6 +767,12 @@ begin
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
if not FoundHighlighter then begin
|
||||
// Show current custom settings
|
||||
for i:=0 to SynSQLSynSQLSample.AttrCount - 1 do begin
|
||||
SynSQLSynSQLSample.Attribute[i].AssignColorAndStyle(MainForm.SynSQLSynUsed.Attribute[i]);
|
||||
end;
|
||||
end;
|
||||
Modified(Sender);
|
||||
end;
|
||||
|
||||
|
Reference in New Issue
Block a user