IDE, SourceEditor: fixed crash in code completion measure item, after 86db8d9f83

This commit is contained in:
Martin 2024-10-22 00:29:32 +02:00
parent 57d4df0996
commit 18b52eff3e

View File

@ -385,6 +385,7 @@ begin
// first write the type
// var, procedure, property, function, type, const
AColor := clNone;
case IdentItem.GetDesc of
ctnVarDefinition, ctnRecordCase:
@ -392,6 +393,7 @@ begin
if UseImages then
ImageIndexCC := IDEImages.LoadImage('cc_variable')
else begin
if Colors <> nil then
AColor:=Colors.Color[ahaIdentComplWindowEntryVar].Foreground;
s:='var';
end;
@ -420,6 +422,7 @@ begin
end
else
begin
if Colors <> nil then
AColor:=Colors.Color[ahaIdentComplWindowEntryType].Foreground;
s:='type';
end;
@ -427,6 +430,7 @@ begin
ctnConstDefinition,ctnConstant:
begin
if Colors <> nil then
AColor:=Colors.Color[ahaIdentComplWindowEntryConst].Foreground;
s:='const';
if UseImages then
@ -450,11 +454,13 @@ begin
begin
if IdentItem.IsFunction then
begin
if Colors <> nil then
AColor:=Colors.Color[ahaIdentComplWindowEntryFunc].Foreground;
s:='function';
end
else
begin
if Colors <> nil then
AColor:=Colors.Color[ahaIdentComplWindowEntryProc].Foreground;
if IdentItem.IsConstructor then
s := 'constructor'
@ -463,12 +469,14 @@ begin
else
s:='procedure';
end;
if Colors <> nil then begin
if IdentItem.TryIsAbstractMethod then
AColor:=Colors.Color[ahaIdentComplWindowEntryMethAbstract].Foreground;
if iliHasLowerVisibility in IdentItem.Flags then
AColor:=Colors.Color[ahaIdentComplWindowEntryMethodLowVis].Foreground;
end;
end;
end;
ctnProperty,ctnGlobalProperty:
begin
@ -482,6 +490,7 @@ begin
end
else
begin
if Colors <> nil then
AColor:=Colors.Color[ahaIdentComplWindowEntryProp].Foreground;
s:='property';
if IsReadOnly then
@ -495,6 +504,7 @@ begin
ImageIndexCC := IDEImages.LoadImage('cc_enum')
else
begin
if Colors <> nil then
AColor:=Colors.Color[ahaIdentComplWindowEntryEnum].Foreground;
s:='enum';
end;
@ -506,6 +516,7 @@ begin
ImageIndexCC := IDEImages.LoadImage('cc_label')
else
begin
if Colors <> nil then
AColor:=Colors.Color[ahaIdentComplWindowEntryLabel].Foreground;
s:='label';
end;
@ -517,6 +528,7 @@ begin
ImageIndexCC := IDEImages.LoadImage('cc_unit')
else
begin
if Colors <> nil then
AColor:=Colors.Color[ahaIdentComplWindowEntryUnit].Foreground;
s:='unit';
end;
@ -528,6 +540,7 @@ begin
ImageIndexCC := IDEImages.LoadImage('cc_namespace')
else
begin
if Colors <> nil then
AColor:=Colors.Color[ahaIdentComplWindowEntryNameSpace].Foreground;
s:='namespace';
end;
@ -535,12 +548,14 @@ begin
ctnWord:
begin
if Colors <> nil then
AColor:=Colors.Color[ahaIdentComplWindowEntryText].Foreground;
s:='text';
end;
ctnCodeTemplate:
begin
if Colors <> nil then
AColor:=Colors.Color[ahaIdentComplWindowEntryTempl].Foreground;
s:='template';
end;
@ -549,15 +564,18 @@ begin
if not UseImages then
begin
if iliKeyword in IdentItem.Flags then begin
if Colors <> nil then
AColor:=Colors.Color[ahaIdentComplWindowEntryKeyword].Foreground;
s:='keyword';
end else begin
if Colors <> nil then
AColor:=Colors.Color[ahaIdentComplWindowEntryUnknown].Foreground;
s:='';
end;
end;
else
if Colors <> nil then
AColor:=Colors.Color[ahaIdentComplWindowEntryUnknown].Foreground;
s:='';
end;