mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-12-14 18:20:31 +01:00
IDE, SourceEditor: fixed crash in code completion measure item, after 86db8d9f83
This commit is contained in:
parent
57d4df0996
commit
18b52eff3e
@ -385,6 +385,7 @@ begin
|
|||||||
|
|
||||||
// first write the type
|
// first write the type
|
||||||
// var, procedure, property, function, type, const
|
// var, procedure, property, function, type, const
|
||||||
|
AColor := clNone;
|
||||||
case IdentItem.GetDesc of
|
case IdentItem.GetDesc of
|
||||||
|
|
||||||
ctnVarDefinition, ctnRecordCase:
|
ctnVarDefinition, ctnRecordCase:
|
||||||
@ -392,6 +393,7 @@ begin
|
|||||||
if UseImages then
|
if UseImages then
|
||||||
ImageIndexCC := IDEImages.LoadImage('cc_variable')
|
ImageIndexCC := IDEImages.LoadImage('cc_variable')
|
||||||
else begin
|
else begin
|
||||||
|
if Colors <> nil then
|
||||||
AColor:=Colors.Color[ahaIdentComplWindowEntryVar].Foreground;
|
AColor:=Colors.Color[ahaIdentComplWindowEntryVar].Foreground;
|
||||||
s:='var';
|
s:='var';
|
||||||
end;
|
end;
|
||||||
@ -420,6 +422,7 @@ begin
|
|||||||
end
|
end
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
|
if Colors <> nil then
|
||||||
AColor:=Colors.Color[ahaIdentComplWindowEntryType].Foreground;
|
AColor:=Colors.Color[ahaIdentComplWindowEntryType].Foreground;
|
||||||
s:='type';
|
s:='type';
|
||||||
end;
|
end;
|
||||||
@ -427,6 +430,7 @@ begin
|
|||||||
|
|
||||||
ctnConstDefinition,ctnConstant:
|
ctnConstDefinition,ctnConstant:
|
||||||
begin
|
begin
|
||||||
|
if Colors <> nil then
|
||||||
AColor:=Colors.Color[ahaIdentComplWindowEntryConst].Foreground;
|
AColor:=Colors.Color[ahaIdentComplWindowEntryConst].Foreground;
|
||||||
s:='const';
|
s:='const';
|
||||||
if UseImages then
|
if UseImages then
|
||||||
@ -450,11 +454,13 @@ begin
|
|||||||
begin
|
begin
|
||||||
if IdentItem.IsFunction then
|
if IdentItem.IsFunction then
|
||||||
begin
|
begin
|
||||||
|
if Colors <> nil then
|
||||||
AColor:=Colors.Color[ahaIdentComplWindowEntryFunc].Foreground;
|
AColor:=Colors.Color[ahaIdentComplWindowEntryFunc].Foreground;
|
||||||
s:='function';
|
s:='function';
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
|
if Colors <> nil then
|
||||||
AColor:=Colors.Color[ahaIdentComplWindowEntryProc].Foreground;
|
AColor:=Colors.Color[ahaIdentComplWindowEntryProc].Foreground;
|
||||||
if IdentItem.IsConstructor then
|
if IdentItem.IsConstructor then
|
||||||
s := 'constructor'
|
s := 'constructor'
|
||||||
@ -463,12 +469,14 @@ begin
|
|||||||
else
|
else
|
||||||
s:='procedure';
|
s:='procedure';
|
||||||
end;
|
end;
|
||||||
|
if Colors <> nil then begin
|
||||||
if IdentItem.TryIsAbstractMethod then
|
if IdentItem.TryIsAbstractMethod then
|
||||||
AColor:=Colors.Color[ahaIdentComplWindowEntryMethAbstract].Foreground;
|
AColor:=Colors.Color[ahaIdentComplWindowEntryMethAbstract].Foreground;
|
||||||
if iliHasLowerVisibility in IdentItem.Flags then
|
if iliHasLowerVisibility in IdentItem.Flags then
|
||||||
AColor:=Colors.Color[ahaIdentComplWindowEntryMethodLowVis].Foreground;
|
AColor:=Colors.Color[ahaIdentComplWindowEntryMethodLowVis].Foreground;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
ctnProperty,ctnGlobalProperty:
|
ctnProperty,ctnGlobalProperty:
|
||||||
begin
|
begin
|
||||||
@ -482,6 +490,7 @@ begin
|
|||||||
end
|
end
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
|
if Colors <> nil then
|
||||||
AColor:=Colors.Color[ahaIdentComplWindowEntryProp].Foreground;
|
AColor:=Colors.Color[ahaIdentComplWindowEntryProp].Foreground;
|
||||||
s:='property';
|
s:='property';
|
||||||
if IsReadOnly then
|
if IsReadOnly then
|
||||||
@ -495,6 +504,7 @@ begin
|
|||||||
ImageIndexCC := IDEImages.LoadImage('cc_enum')
|
ImageIndexCC := IDEImages.LoadImage('cc_enum')
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
|
if Colors <> nil then
|
||||||
AColor:=Colors.Color[ahaIdentComplWindowEntryEnum].Foreground;
|
AColor:=Colors.Color[ahaIdentComplWindowEntryEnum].Foreground;
|
||||||
s:='enum';
|
s:='enum';
|
||||||
end;
|
end;
|
||||||
@ -506,6 +516,7 @@ begin
|
|||||||
ImageIndexCC := IDEImages.LoadImage('cc_label')
|
ImageIndexCC := IDEImages.LoadImage('cc_label')
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
|
if Colors <> nil then
|
||||||
AColor:=Colors.Color[ahaIdentComplWindowEntryLabel].Foreground;
|
AColor:=Colors.Color[ahaIdentComplWindowEntryLabel].Foreground;
|
||||||
s:='label';
|
s:='label';
|
||||||
end;
|
end;
|
||||||
@ -517,6 +528,7 @@ begin
|
|||||||
ImageIndexCC := IDEImages.LoadImage('cc_unit')
|
ImageIndexCC := IDEImages.LoadImage('cc_unit')
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
|
if Colors <> nil then
|
||||||
AColor:=Colors.Color[ahaIdentComplWindowEntryUnit].Foreground;
|
AColor:=Colors.Color[ahaIdentComplWindowEntryUnit].Foreground;
|
||||||
s:='unit';
|
s:='unit';
|
||||||
end;
|
end;
|
||||||
@ -528,6 +540,7 @@ begin
|
|||||||
ImageIndexCC := IDEImages.LoadImage('cc_namespace')
|
ImageIndexCC := IDEImages.LoadImage('cc_namespace')
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
|
if Colors <> nil then
|
||||||
AColor:=Colors.Color[ahaIdentComplWindowEntryNameSpace].Foreground;
|
AColor:=Colors.Color[ahaIdentComplWindowEntryNameSpace].Foreground;
|
||||||
s:='namespace';
|
s:='namespace';
|
||||||
end;
|
end;
|
||||||
@ -535,12 +548,14 @@ begin
|
|||||||
|
|
||||||
ctnWord:
|
ctnWord:
|
||||||
begin
|
begin
|
||||||
|
if Colors <> nil then
|
||||||
AColor:=Colors.Color[ahaIdentComplWindowEntryText].Foreground;
|
AColor:=Colors.Color[ahaIdentComplWindowEntryText].Foreground;
|
||||||
s:='text';
|
s:='text';
|
||||||
end;
|
end;
|
||||||
|
|
||||||
ctnCodeTemplate:
|
ctnCodeTemplate:
|
||||||
begin
|
begin
|
||||||
|
if Colors <> nil then
|
||||||
AColor:=Colors.Color[ahaIdentComplWindowEntryTempl].Foreground;
|
AColor:=Colors.Color[ahaIdentComplWindowEntryTempl].Foreground;
|
||||||
s:='template';
|
s:='template';
|
||||||
end;
|
end;
|
||||||
@ -549,15 +564,18 @@ begin
|
|||||||
if not UseImages then
|
if not UseImages then
|
||||||
begin
|
begin
|
||||||
if iliKeyword in IdentItem.Flags then begin
|
if iliKeyword in IdentItem.Flags then begin
|
||||||
|
if Colors <> nil then
|
||||||
AColor:=Colors.Color[ahaIdentComplWindowEntryKeyword].Foreground;
|
AColor:=Colors.Color[ahaIdentComplWindowEntryKeyword].Foreground;
|
||||||
s:='keyword';
|
s:='keyword';
|
||||||
end else begin
|
end else begin
|
||||||
|
if Colors <> nil then
|
||||||
AColor:=Colors.Color[ahaIdentComplWindowEntryUnknown].Foreground;
|
AColor:=Colors.Color[ahaIdentComplWindowEntryUnknown].Foreground;
|
||||||
s:='';
|
s:='';
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
else
|
else
|
||||||
|
if Colors <> nil then
|
||||||
AColor:=Colors.Color[ahaIdentComplWindowEntryUnknown].Foreground;
|
AColor:=Colors.Color[ahaIdentComplWindowEntryUnknown].Foreground;
|
||||||
s:='';
|
s:='';
|
||||||
end;
|
end;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user