mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-29 20:50:18 +02:00
SynEdit: PasHighLighter, fix "type" in "class" blocks. Broken in 9db0c4e54e
This commit is contained in:
parent
c4773c0a42
commit
cca9327230
@ -1798,10 +1798,13 @@ begin
|
||||
end;
|
||||
|
||||
function TSynPasSyn.Func66: TtkTokenKind;
|
||||
var
|
||||
tfb: TPascalCodeFoldBlockType;
|
||||
begin
|
||||
if KeyComp('Type') then begin
|
||||
tfb := TopPascalCodeFoldBlockType;
|
||||
if (PasCodeFoldRange.BracketNestLevel = 0)
|
||||
and (TopPascalCodeFoldBlockType in
|
||||
and (tfb in
|
||||
[cfbtVarType, cfbtLocalVarType, cfbtNone, cfbtProcedure, cfbtAnonymousProcedure, cfbtProgram,
|
||||
cfbtUnit, cfbtUnitSection,
|
||||
cfbtClass, cfbtClassSection, cfbtRecord // if inside a type section in class/record
|
||||
@ -1812,11 +1815,14 @@ begin
|
||||
fRange := fRange + [rsAfterEqualThenType];
|
||||
end
|
||||
else begin
|
||||
if TopPascalCodeFoldBlockType in [cfbtVarType, cfbtLocalVarType] then
|
||||
if tfb in [cfbtVarType, cfbtLocalVarType] then begin
|
||||
EndPascalCodeFoldBlockLastLine;
|
||||
if TopPascalCodeFoldBlockType in [cfbtProcedure, cfbtAnonymousProcedure]
|
||||
then StartPascalCodeFoldBlock(cfbtLocalVarType)
|
||||
else StartPascalCodeFoldBlock(cfbtVarType);
|
||||
tfb := TopPascalCodeFoldBlockType;
|
||||
end;
|
||||
if not(tfb in [cfbtClass, cfbtClassSection, cfbtRecord]) then
|
||||
if tfb in [cfbtProcedure, cfbtAnonymousProcedure]
|
||||
then StartPascalCodeFoldBlock(cfbtLocalVarType)
|
||||
else StartPascalCodeFoldBlock(cfbtVarType);
|
||||
fRange := fRange + [rsInTypeBlock];
|
||||
end;
|
||||
end;
|
||||
|
Loading…
Reference in New Issue
Block a user