mirror of https://gitlab.com/basile.b/dexed.git
editor, completion menu, decorate the comp kind
This commit is contained in:
parent
f9f9383ab4
commit
6457a91839
|
@ -1949,7 +1949,7 @@ begin
|
||||||
//
|
//
|
||||||
fCompletion.Position := 0;
|
fCompletion.Position := 0;
|
||||||
fCompletion.ItemList.Clear;
|
fCompletion.ItemList.Clear;
|
||||||
DcdWrapper.getComplAtCursor(fCompletion.ItemList);
|
DcdWrapper.getComplAtCursor(TStringList(fCompletion.ItemList));
|
||||||
if fLastCompletion.isNotEmpty then
|
if fLastCompletion.isNotEmpty then
|
||||||
begin
|
begin
|
||||||
i := fCompletion.ItemList.IndexOf(fLastCompletion);
|
i := fCompletion.ItemList.IndexOf(fLastCompletion);
|
||||||
|
@ -1976,6 +1976,7 @@ end;
|
||||||
function TCESynMemo.completionItemPaint(const AKey: string; ACanvas: TCanvas;X, Y: integer;
|
function TCESynMemo.completionItemPaint(const AKey: string; ACanvas: TCanvas;X, Y: integer;
|
||||||
Selected: boolean; Index: integer): boolean;
|
Selected: boolean; Index: integer): boolean;
|
||||||
var
|
var
|
||||||
|
dck: TDCDCompletionKind;
|
||||||
knd: string;
|
knd: string;
|
||||||
len: Integer;
|
len: Integer;
|
||||||
begin
|
begin
|
||||||
|
@ -1984,12 +1985,26 @@ begin
|
||||||
if aKey.isEmpty then
|
if aKey.isEmpty then
|
||||||
exit;
|
exit;
|
||||||
{$PUSH} {$Warnings OFF} {$Hints OFF}
|
{$PUSH} {$Warnings OFF} {$Hints OFF}
|
||||||
knd := DcdCompletionKindStrings[TDCDCompletionKind(
|
dck := TDCDCompletionKind(PtrUInt(fCompletion.ItemList.Objects[index]));
|
||||||
PtrUInt(fCompletion.ItemList.Objects[index]))];
|
knd := DcdCompletionKindStrings[dck];
|
||||||
{$POP}
|
{$POP}
|
||||||
ACanvas.Font.Style := [fsBold];
|
ACanvas.Font.Style := [fsBold];
|
||||||
len := ACanvas.TextExtent(aKey).cx;
|
len := ACanvas.TextExtent(aKey).cx;
|
||||||
ACanvas.TextOut(2 + X , Y, aKey);
|
ACanvas.TextOut(2 + X , Y, aKey);
|
||||||
|
case dck of
|
||||||
|
dckALias, dckClass, dckStruct, dckUnion, dckEnum, dckInterface:
|
||||||
|
ACanvas.Font.Color:= clMaroon;
|
||||||
|
dckMember, dckEnum_member, dckVariable, dckArray, dckAA:
|
||||||
|
ACanvas.Font.Color:= clGray;
|
||||||
|
dckReserved:
|
||||||
|
ACanvas.Font.Color:= clNavy;
|
||||||
|
dckFunction:
|
||||||
|
ACanvas.Font.Color:= clGreen;
|
||||||
|
dckPackage, dckModule:
|
||||||
|
ACanvas.Font.Color:= clBlue;
|
||||||
|
dckTemplate, dckMixin:
|
||||||
|
ACanvas.Font.Color:= clTeal;
|
||||||
|
end;
|
||||||
ACanvas.Font.Style := [fsItalic];
|
ACanvas.Font.Style := [fsItalic];
|
||||||
ACanvas.TextOut(2 + X + len + 2, Y, knd);
|
ACanvas.TextOut(2 + X + len + 2, Y, knd);
|
||||||
end;
|
end;
|
||||||
|
|
Loading…
Reference in New Issue