mirror of
https://github.com/HeidiSQL/HeidiSQL.git
synced 2025-08-26 11:17:57 +08:00
Issue #8: show current highlighter colors as "Current custom settings" preset, in preferences dialog
This commit is contained in:
@ -810,8 +810,12 @@ object optionsform: Toptionsform
|
||||
Width = 284
|
||||
Height = 21
|
||||
Style = csDropDownList
|
||||
ItemIndex = 0
|
||||
TabOrder = 12
|
||||
Text = 'Current custom settings'
|
||||
OnChange = comboEditorColorsPresetChange
|
||||
Items.Strings = (
|
||||
'Current custom settings')
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -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