SynEdit: Pas HL, fix markup if "procedure" is outlined, but top level "begin" is not. Part 2 of Issue #0034410

git-svn-id: trunk@59298 -
This commit is contained in:
martin 2018-10-15 00:09:18 +00:00
parent 6769e903a6
commit 22d26674f7
2 changed files with 7 additions and 2 deletions

View File

@ -91,6 +91,7 @@ type
sfaOutlineKeepLevel, // Direct children should not increase color dept. (But grandchild can.) e.g. "if","then" any "procedure"
sfaOutlineMergeParent,// This node want to decrease current color depth. (But Previous sibling increased) e.g. "except", "finally"
sfaOutlineForceIndent, // Node will temporary ignore sfaOutlineKeep. (Next sibling can.) e.g in NESTED "procedure"
// TODO: review sfaOutlineNoColor / see issue 0034410
sfaOutlineNoColor, // Node will not painted by nested-coloring, but may increase color (e.g. any "procedure")
sfaOutlineNoLine, // Node doesn't want to have vertical line. (e.g. "then")
sfaInvalid, // Wrong Index

View File

@ -3708,6 +3708,7 @@ var
PasBlockType: TPascalCodeFoldBlockType;
EndOffs: Integer;
OneLine: Boolean;
t: TSynCustomFoldConfig;
begin
PasBlockType := TPascalCodeFoldBlockType(PtrUint(ABlockType));
@ -3729,8 +3730,11 @@ begin
if (PasBlockType in [cfbtClassSection]) then
Include( aActions, sfaOutlineMergeParent);
if (PasBlockType in [cfbtProcedure]) then
aActions := aActions + [sfaOutlineKeepLevel,sfaOutlineNoColor];
if (PasBlockType in [cfbtProcedure]) then begin
t := FFoldConfig[ord(cfbtTopBeginEnd)];
if t.Enabled and (sfaOutline in t.FoldActions) then
aActions := aActions + [sfaOutlineKeepLevel,sfaOutlineNoColor];
end;
//if (PasBlockType in [cfbtProcedure]) and (InProcLevel > 0) then //nested
// aActions := aActions + [sfaOutlineForceIndent];