IDE: Identifier completion window: remove IdentComplHighlightPrefix option - use color only.

git-svn-id: trunk@57123 -
This commit is contained in:
ondrej 2018-01-19 13:47:55 +00:00
parent e1b8d1ba7c
commit b5f2b9bf9a
6 changed files with 10 additions and 37 deletions

View File

@ -113,7 +113,6 @@ type
FIdentComplAutoStartAfterPoint: boolean;
FIdentComplAutoUseSingleIdent: boolean;
FIdentComplUseContainsFilter: Boolean;
FIdentComplHighlightPrefix: Boolean;
FIdentComplShowIcons: Boolean;
// auto indentation
@ -245,8 +244,6 @@ type
write FIdentComplAutoUseSingleIdent;
property IdentComplUseContainsFilter: boolean read FIdentComplUseContainsFilter
write FIdentComplUseContainsFilter;
property IdentComplHighlightPrefix: boolean read FIdentComplHighlightPrefix
write FIdentComplHighlightPrefix;
property IdentComplShowIcons: boolean read FIdentComplShowIcons
write FIdentComplShowIcons;
property IdentComplAddParameterBrackets: boolean
@ -550,8 +547,6 @@ begin
'CodeToolsOptions/IdentifierCompletion/AutoUseSingleIdent',true);
FIdentComplUseContainsFilter:=XMLConfig.GetValue(
'CodeToolsOptions/IdentifierCompletion/UseContainsFilter',true);
FIdentComplHighlightPrefix:=XMLConfig.GetValue(
'CodeToolsOptions/IdentifierCompletion/HighlightPrefix',true);
FIdentComplShowIcons:=XMLConfig.GetValue(
'CodeToolsOptions/IdentifierCompletion/ShowIcons',true);
FIdentComplAddParameterBrackets:=XMLConfig.GetValue(
@ -724,8 +719,6 @@ begin
FIdentComplAutoUseSingleIdent,true);
XMLConfig.SetDeleteValue('CodeToolsOptions/IdentifierCompletion/UseContainsFilter',
FIdentComplUseContainsFilter,true);
XMLConfig.SetDeleteValue('CodeToolsOptions/IdentifierCompletion/HighlightPrefix',
FIdentComplHighlightPrefix,true);
XMLConfig.SetDeleteValue('CodeToolsOptions/IdentifierCompletion/ShowIcons',
FIdentComplShowIcons,true);
XMLConfig.SetDeleteValue('CodeToolsOptions/IdentifierCompletion/AutoAddParameterBrackets',
@ -877,7 +870,6 @@ begin
FIdentComplAutoStartAfterPoint:=CodeToolsOpts.FIdentComplAutoStartAfterPoint;
FIdentComplAutoUseSingleIdent:=CodeToolsOpts.FIdentComplAutoUseSingleIdent;
FIdentComplUseContainsFilter:=CodeToolsOpts.FIdentComplUseContainsFilter;
FIdentComplHighlightPrefix:=CodeToolsOpts.FIdentComplHighlightPrefix;
FIdentComplShowIcons:=CodeToolsOpts.FIdentComplShowIcons;
FIdentComplAddParameterBrackets:=CodeToolsOpts.FIdentComplAddParameterBrackets;
FIdentComplReplaceIdentifier:=CodeToolsOpts.FIdentComplReplaceIdentifier;
@ -945,7 +937,6 @@ begin
FIdentComplAutoStartAfterPoint:=true;
FIdentComplAutoUseSingleIdent:=true;
FIdentComplUseContainsFilter:=true;
FIdentComplHighlightPrefix:=true;
FIdentComplShowIcons:=true;
FIdentComplAddParameterBrackets:=true;
FIdentComplReplaceIdentifier:=true;
@ -1032,7 +1023,6 @@ begin
and (FIdentComplAutoStartAfterPoint=CodeToolsOpts.FIdentComplAutoStartAfterPoint)
and (FIdentComplAutoUseSingleIdent=CodeToolsOpts.FIdentComplAutoUseSingleIdent)
and (FIdentComplUseContainsFilter=CodeToolsOpts.FIdentComplUseContainsFilter)
and (FIdentComplHighlightPrefix=CodeToolsOpts.FIdentComplHighlightPrefix)
and (FIdentComplShowIcons=CodeToolsOpts.FIdentComplShowIcons)
and (FIdentComplAddParameterBrackets=CodeToolsOpts.FIdentComplAddParameterBrackets)
and (FIdentComplReplaceIdentifier=CodeToolsOpts.FIdentComplReplaceIdentifier)

View File

@ -78,12 +78,12 @@ object CodetoolsIndentifierCompletionOptionsFrame: TCodetoolsIndentifierCompleti
AnchorSideRight.Side = asrBottom
Left = 0
Height = 19
Top = 321
Top = 302
Width = 124
Caption = 'ICReplaceCheckBox'
ParentShowHint = False
ShowHint = True
TabOrder = 12
TabOrder = 11
end
object ICAddDoCheckBox: TCheckBox
AnchorSideLeft.Control = Owner
@ -174,7 +174,7 @@ object CodetoolsIndentifierCompletionOptionsFrame: TCodetoolsIndentifierCompleti
AnchorSideRight.Side = asrBottom
Left = 0
Height = 15
Top = 306
Top = 287
Width = 537
Caption = 'ICMiscDividerBevel'
Anchors = [akTop, akLeft, akRight]
@ -189,12 +189,12 @@ object CodetoolsIndentifierCompletionOptionsFrame: TCodetoolsIndentifierCompleti
AnchorSideRight.Side = asrBottom
Left = 0
Height = 19
Top = 340
Top = 321
Width = 151
Caption = 'ICJumpToErrorCheckBox'
ParentShowHint = False
ShowHint = True
TabOrder = 13
TabOrder = 12
end
object ICAutoUseSingleIdent: TCheckBox
AnchorSideLeft.Control = Owner
@ -237,26 +237,15 @@ object CodetoolsIndentifierCompletionOptionsFrame: TCodetoolsIndentifierCompleti
Font.Style = [fsBold]
ParentFont = False
end
object ICHighlightPrefixCheckBox: TCheckBox
object ICUseIconsInCompletionBoxCheckBox: TCheckBox
AnchorSideLeft.Control = Owner
AnchorSideTop.Control = ICAppearanceDividerBevel
AnchorSideTop.Side = asrBottom
Left = 0
Height = 19
Top = 266
Width = 162
Caption = 'ICHighlightPrefixCheckBox'
TabOrder = 10
end
object ICUseIconsInCompletionBoxCheckBox: TCheckBox
AnchorSideLeft.Control = Owner
AnchorSideTop.Control = ICHighlightPrefixCheckBox
AnchorSideTop.Side = asrBottom
Left = 0
Height = 19
Top = 285
Width = 222
Caption = 'ICUseIconsInCompletionBoxCheckBox'
TabOrder = 11
TabOrder = 10
end
end

View File

@ -34,7 +34,6 @@ type
TCodetoolsIndentifierCompletionOptionsFrame = class(TAbstractIDEOptionsEditor)
ICContainsFilterCheckBox: TCheckBox;
ICHighlightPrefixCheckBox: TCheckBox;
ICAddDoCheckBox: TCheckBox;
ICAutoAddParameterBracketsCheckBox: TCheckBox;
ICMiscDividerBevel: TDividerBevel;
@ -96,7 +95,6 @@ begin
ICContainsFilterCheckBox.Caption := dlgIncludeIdentifiersContainingPrefix;
ICAppearanceDividerBevel.Caption:=lisAppearance;
ICHighlightPrefixCheckBox.Caption := dlgHighlightPrefix;
ICUseIconsInCompletionBoxCheckBox.Caption := dlgUseIconsInCompletionBox;
ICMiscDividerBevel.Caption:=dlgEnvMisc;
@ -123,7 +121,6 @@ begin
ICSortForHistoryCheckBox.Checked:=IdentComplSortForHistory;
ICSortForScopeCheckBox.Checked:=IdentComplSortForScope;
ICContainsFilterCheckBox.Checked:=IdentComplUseContainsFilter;
ICHighlightPrefixCheckBox.Checked:=IdentComplHighlightPrefix;
ICUseIconsInCompletionBoxCheckBox.Checked:=IdentComplShowIcons;
end;
end;
@ -145,7 +142,6 @@ begin
IdentComplSortForHistory:=ICSortForHistoryCheckBox.Checked;
IdentComplSortForScope:=ICSortForScopeCheckBox.Checked;
IdentComplUseContainsFilter:=ICContainsFilterCheckBox.Checked;
IdentComplHighlightPrefix:=ICHighlightPrefixCheckBox.Checked;
IdentComplShowIcons:=ICUseIconsInCompletionBoxCheckBox.Checked;
end;
end;

View File

@ -1969,7 +1969,6 @@ resourcestring
lisCompletionLongLineHintTypeLittleLeft = 'Extend some left';
lisCompletionLongLineHintTypeFullLeft = 'Extend far left';
dlgIncludeIdentifiersContainingPrefix = 'Include identifiers containing prefix';
dlgHighlightPrefix = 'Highlight prefix';
lisAutomaticFeatures = 'Completion and Hints';
lisAutoMarkup = 'Markup and Matches';
dlgUseIconsInCompletionBox = 'Icons in code completion box';

View File

@ -2134,7 +2134,7 @@ Begin
FActiveEditBackgroundColor := Editor.Color;
FActiveEditTextSelectedColor := TSynEdit(Editor).SelectedColor.Foreground;
FActiveEditBackgroundSelectedColor := TSynEdit(Editor).SelectedColor.Background;
FActiveEditTextHighLightColor := RGBToColor(200, 13, 13);
FActiveEditTextHighLightColor := clNone;
if Editor.Highlighter<>nil
then begin

View File

@ -515,15 +515,14 @@ begin
//DebugLn(['PaintCompletionItem ',x,',',y,' ',s]);
ACanvas.TextOut(x+1,y,s);
// highlighting the prefix
if (CodeToolsOpts.IdentComplHighlightPrefix)
if (Colors<>nil) and (Colors^.TextHighLightColor<>clNone)
and (aCompletion.CurrentString<>'') then
begin
PrefixPosition := Pos(LowerCase(aCompletion.CurrentString), LowerCase(s));
Prefix := Copy(s, PrefixPosition, Length(aCompletion.CurrentString));
if PrefixPosition > 0 then
PrefixPosition := ACanvas.TextWidth(Copy(s, 1, PrefixPosition-1));
if Colors<>nil then
SetFontColor(ColorToRGB(Colors^.TextHighLightColor));
SetFontColor(ColorToRGB(Colors^.TextHighLightColor));
ACanvas.TextOut(x+PrefixPosition+1,y,Prefix);
end;
inc(x,ACanvas.TextWidth(s)+1);