SynEdit: Pas HL, fix folding/markup for code containing "case", if "case" is not enabled for fold/markup. Part 1 of Issue #0034410

git-svn-id: trunk@59297 -
This commit is contained in:
martin 2018-10-14 23:47:42 +00:00
parent 5bbd8d5a05
commit 6769e903a6

View File

@ -971,7 +971,7 @@ begin
else else
if (TopPascalCodeFoldBlockType = cfbtCase) then begin if (TopPascalCodeFoldBlockType = cfbtCase) then begin
EndPascalCodeFoldBlock(); EndPascalCodeFoldBlock();
StartPascalCodeFoldBlock(cfbtCase); StartPascalCodeFoldBlock(cfbtCase, True);
fRange := fRange + [rsAtCaseLabel]; fRange := fRange + [rsAtCaseLabel];
end; end;
end end
@ -1082,7 +1082,7 @@ begin
end end
else if KeyComp('Case') then begin else if KeyComp('Case') then begin
if TopPascalCodeFoldBlockType in PascalStatementBlocks + [cfbtUnitSection] then if TopPascalCodeFoldBlockType in PascalStatementBlocks + [cfbtUnitSection] then
StartPascalCodeFoldBlock(cfbtCase); StartPascalCodeFoldBlock(cfbtCase, True);
Result := tkKey; Result := tkKey;
end end
else else
@ -1204,7 +1204,7 @@ begin
end else end else
if TopPascalCodeFoldBlockType = cfbtCase then begin if TopPascalCodeFoldBlockType = cfbtCase then begin
FTokenIsCaseLabel := True; FTokenIsCaseLabel := True;
StartPascalCodeFoldBlock(cfbtCaseElse); StartPascalCodeFoldBlock(cfbtCaseElse, True);
end end
end end
else if KeyComp('Var') then begin else if KeyComp('Var') then begin
@ -2019,7 +2019,7 @@ begin
EndPascalCodeFoldBlockLastLine; EndPascalCodeFoldBlockLastLine;
end; end;
if TopPascalCodeFoldBlockType = cfbtCase then begin if TopPascalCodeFoldBlockType = cfbtCase then begin
StartPascalCodeFoldBlock(cfbtCaseElse); StartPascalCodeFoldBlock(cfbtCaseElse, True);
FTokenIsCaseLabel := True; FTokenIsCaseLabel := True;
end; end;
end end