@@ -341,6 +341,12 @@ procedure TEditorOptForm.FormCreate(Sender: TObject);
341
341
try
342
342
StrtoAttr(Attribute , devEditor.Syntax.Values[AttrName]);
343
343
cpp.Attribute [I].Assign(Attribute );
344
+
345
+ if SameText(cpp.Attribute [I].Name , ' WhiteSpace' ) or SameText(cpp.Attribute [I].Name , ' Space' ) then begin
346
+ cpCompletionBackground.NoneColorColor := cpp.Attribute [I].Background;
347
+ cpCompletionBackground.DefaultColorColor := cpp.Attribute [I].Background;
348
+ end ;
349
+
344
350
finally
345
351
Attribute .Free;
346
352
end ;
@@ -406,7 +412,14 @@ procedure TEditorOptForm.FormCreate(Sender: TObject);
406
412
chkCBParseLocalH.Checked := devCodeCompletion.ParseLocalHeaders;
407
413
chkCBParseGlobalH.Checked := devCodeCompletion.ParseGlobalHeaders;
408
414
tbCompletionDelay.Position := devCodeCompletion.Delay;
409
- cpCompletionBackground.Selected := devCodeCompletion.BackColor;
415
+
416
+ cpCompletionBackground.Items.InsertObject(1 , ' Default' , TObject(cpCompletionBackground.DefaultColorColor));
417
+
418
+ if cpCompletionBackground.DefaultColorColor = devCodeCompletion.BackColor then
419
+ cpCompletionBackground.ItemIndex := 1
420
+ else
421
+ cpCompletionBackground.Selected := devCodeCompletion.BackColor;
422
+
410
423
chkEnableCompletionClick(nil );
411
424
412
425
// Symbol Completion
@@ -438,7 +451,6 @@ procedure TEditorOptForm.FormCreate(Sender: TObject);
438
451
// Set defaults of color buttons, don't want all system colors too
439
452
cpMarginColor.Items.InsertObject(1 , ' Default' , TObject(cpMarginColor.DefaultColorColor));
440
453
cpHighColor.Items.InsertObject(1 , ' Default' , TObject(cpHighColor.DefaultColorColor));
441
- cpCompletionBackground.Items.InsertObject(1 , ' Default' , TObject(cpCompletionBackground.DefaultColorColor));
442
454
end ;
443
455
444
456
procedure TEditorOptForm.cboEditorFontDrawItem (Control: TWinControl; Index: Integer; Rect: TRect; State:
@@ -823,7 +835,11 @@ procedure TEditorOptForm.btnOkClick(Sender: TObject);
823
835
with devCodeCompletion do begin
824
836
Enabled := chkEnableCompletion.Checked;
825
837
Delay := tbCompletionDelay.Position;
826
- BackColor := cpCompletionBackground.Selected;
838
+ if cpCompletionBackground.ItemIndex = 1 then
839
+ BackColor := cpCompletionBackground.DefaultColorColor
840
+ else
841
+ BackColor := cpCompletionBackground.Selected;
842
+
827
843
ParseLocalHeaders := chkCBParseLocalH.Checked;
828
844
ParseGlobalHeaders := chkCBParseGlobalH.Checked;
829
845
end ;
@@ -989,9 +1005,13 @@ procedure TEditorOptForm.StyleChange(Sender: TObject);
989
1005
Background := cpBackground.Selected;
990
1006
991
1007
// Update default color
992
- if SameText(Name , ' WhiteSpace' ) then begin
1008
+ if SameText(Attr. Name , ' WhiteSpace' ) or SameText(Attr. Name , ' Space ' ) then begin
993
1009
ffgColor := Foreground;
994
1010
fbgColor := Background;
1011
+
1012
+ cpCompletionBackground.NoneColorColor := Background;
1013
+ cpCompletionBackground.DefaultColorColor := Background;
1014
+ cpCompletionBackground.Items.Objects[1 ] := TObject(Background);
995
1015
end ;
996
1016
997
1017
Style := [];
@@ -1106,10 +1126,17 @@ procedure TEditorOptForm.cboQuickColorSelect(Sender: TObject);
1106
1126
1107
1127
offset := cboQuickColor.ItemIndex * 1000 ;
1108
1128
for i := 0 to pred(cpp.AttrCount) do begin
1109
- attr := TSynHighlighterAttributes.Create(cpp.Attribute [i].Name ,cpp.Attribute [i].Name );
1129
+ attr := TSynHighlighterAttributes.Create(cpp.Attribute [i].Name , cpp.Attribute [i].Name );
1110
1130
try
1111
1131
StrtoAttr(Attr, LoadStr(i + offset + 1 ));
1112
1132
cpp.Attribute [i].Assign(Attr);
1133
+
1134
+ if SameText(Attr.Name , ' WhiteSpace' ) or SameText(Attr.Name , ' Space' ) then begin
1135
+ cpCompletionBackground.NoneColorColor := Attr.Background;
1136
+ cpCompletionBackground.DefaultColorColor := Attr.Background;
1137
+ cpCompletionBackground.Items.Objects[1 ] := TObject(Attr.Background);
1138
+ end ;
1139
+
1113
1140
finally
1114
1141
Attr.Free;
1115
1142
end ;
0 commit comments