mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-06-11 03:18:33 +02:00
SynEdit: PasHighLighter add nodes for for-do, while-do, with-do. Code by x2nie
git-svn-id: trunk@52181 -
This commit is contained in:
parent
8b3aed5ba5
commit
4299f7779c
@ -126,6 +126,9 @@ type
|
|||||||
cfbtBorCommand, // { ... }
|
cfbtBorCommand, // { ... }
|
||||||
cfbtSlashComment, // //
|
cfbtSlashComment, // //
|
||||||
cfbtIfThen,
|
cfbtIfThen,
|
||||||
|
cfbtForDo,
|
||||||
|
cfbtWhileDo,
|
||||||
|
cfbtWithDo,
|
||||||
// Internal type / not configurable
|
// Internal type / not configurable
|
||||||
cfbtCaseElse, // "else" in case can have multiply statements
|
cfbtCaseElse, // "else" in case can have multiply statements
|
||||||
cfbtPackage,
|
cfbtPackage,
|
||||||
@ -136,7 +139,7 @@ type
|
|||||||
|
|
||||||
|
|
||||||
const
|
const
|
||||||
cfbtLastPublic = cfbtIfThen;
|
cfbtLastPublic = cfbtWithDo;
|
||||||
cfbtFirstPrivate = cfbtCaseElse;
|
cfbtFirstPrivate = cfbtCaseElse;
|
||||||
|
|
||||||
CountPascalCodeFoldBlockOffset: Pointer =
|
CountPascalCodeFoldBlockOffset: Pointer =
|
||||||
@ -148,12 +151,12 @@ const
|
|||||||
[cfbtBeginEnd, cfbtTopBeginEnd, cfbtProcedure, cfbtClass, cfbtProgram, cfbtRecord,
|
[cfbtBeginEnd, cfbtTopBeginEnd, cfbtProcedure, cfbtClass, cfbtProgram, cfbtRecord,
|
||||||
cfbtTry, cfbtExcept, cfbtRepeat, cfbtAsm, cfbtCase, cfbtCaseElse,
|
cfbtTry, cfbtExcept, cfbtRepeat, cfbtAsm, cfbtCase, cfbtCaseElse,
|
||||||
cfbtIfDef, cfbtRegion,
|
cfbtIfDef, cfbtRegion,
|
||||||
cfbtIfThen
|
cfbtIfThen, cfbtForDo,cfbtWhileDo,cfbtWithDo
|
||||||
];
|
];
|
||||||
PascalNoOutlineRanges: TPascalCodeFoldBlockTypes =
|
PascalNoOutlineRanges: TPascalCodeFoldBlockTypes =
|
||||||
[cfbtProgram,cfbtUnit,cfbtUnitSection, cfbtRegion, cfbtProcedure,
|
[cfbtProgram,cfbtUnit,cfbtUnitSection, cfbtRegion, //cfbtProcedure,//=need by nested proc?
|
||||||
cfbtVarType,
|
cfbtVarType, cfbtCaseElse,
|
||||||
cfbtIfDef, cfbtAnsiComment..cfbtSlashComment];
|
cfbtIfDef, cfbtAnsiComment,cfbtBorCommand,cfbtSlashComment, cfbtNestedComment];
|
||||||
|
|
||||||
// restrict cdecl etc to places where they can be.
|
// restrict cdecl etc to places where they can be.
|
||||||
// this needs a better parser
|
// this needs a better parser
|
||||||
@ -164,7 +167,7 @@ const
|
|||||||
|
|
||||||
PascalStatementBlocks: TPascalCodeFoldBlockTypes =
|
PascalStatementBlocks: TPascalCodeFoldBlockTypes =
|
||||||
[cfbtBeginEnd, cfbtTopBeginEnd, cfbtCase, cfbtTry, cfbtExcept, cfbtRepeat,
|
[cfbtBeginEnd, cfbtTopBeginEnd, cfbtCase, cfbtTry, cfbtExcept, cfbtRepeat,
|
||||||
cfbtCaseElse, cfbtIfThen];
|
cfbtCaseElse, cfbtIfThen, cfbtForDo,cfbtWhileDo,cfbtWithDo ];
|
||||||
|
|
||||||
PascalFoldTypeCompatibility: Array [TPascalCodeFoldBlockType] of TPascalCodeFoldBlockType =
|
PascalFoldTypeCompatibility: Array [TPascalCodeFoldBlockType] of TPascalCodeFoldBlockType =
|
||||||
( cfbtBeginEnd, // Nested
|
( cfbtBeginEnd, // Nested
|
||||||
@ -191,6 +194,9 @@ const
|
|||||||
cfbtNestedComment, //cfbtBorCommand, // { ... }
|
cfbtNestedComment, //cfbtBorCommand, // { ... }
|
||||||
cfbtSlashComment, // //
|
cfbtSlashComment, // //
|
||||||
cfbtIfThen,
|
cfbtIfThen,
|
||||||
|
cfbtForDo,
|
||||||
|
cfbtWhileDo,
|
||||||
|
cfbtWithDo,
|
||||||
// Internal type / not configurable
|
// Internal type / not configurable
|
||||||
cfbtCaseElse,
|
cfbtCaseElse,
|
||||||
cfbtPackage,
|
cfbtPackage,
|
||||||
@ -896,8 +902,18 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
function TSynPasSyn.Func19: TtkTokenKind;
|
function TSynPasSyn.Func19: TtkTokenKind;
|
||||||
|
var pas : TPascalCodeFoldBlockType;
|
||||||
begin
|
begin
|
||||||
if KeyComp('Do') then Result := tkKey else
|
if KeyComp('Do') then begin
|
||||||
|
Result := tkKey;
|
||||||
|
pas := TopPascalCodeFoldBlockType;
|
||||||
|
if pas in [cfbtForDo, cfbtWhileDo, cfbtWithDo] then
|
||||||
|
begin
|
||||||
|
EndPascalCodeFoldBlock();
|
||||||
|
StartPascalCodeFoldBlock(pas, True);
|
||||||
|
end
|
||||||
|
end
|
||||||
|
else
|
||||||
if KeyComp('And') then Result := tkKey else Result := tkIdentifier;
|
if KeyComp('And') then Result := tkKey else Result := tkIdentifier;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -918,8 +934,11 @@ begin
|
|||||||
CodeFoldRange.Add(Pointer(PtrInt(cfbtUses)), false);
|
CodeFoldRange.Add(Pointer(PtrInt(cfbtUses)), false);
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
if (TopPascalCodeFoldBlockType = cfbtCase) then
|
if (TopPascalCodeFoldBlockType = cfbtCase) then begin
|
||||||
|
EndPascalCodeFoldBlock();
|
||||||
|
StartPascalCodeFoldBlock(cfbtCase);
|
||||||
fRange := fRange + [rsAtCaseLabel];
|
fRange := fRange + [rsAtCaseLabel];
|
||||||
|
end;
|
||||||
end
|
end
|
||||||
else Result := tkIdentifier;
|
else Result := tkIdentifier;
|
||||||
end;
|
end;
|
||||||
@ -927,6 +946,7 @@ end;
|
|||||||
function TSynPasSyn.Func23: TtkTokenKind;
|
function TSynPasSyn.Func23: TtkTokenKind;
|
||||||
var
|
var
|
||||||
tfb: TPascalCodeFoldBlockType;
|
tfb: TPascalCodeFoldBlockType;
|
||||||
|
sl : integer;
|
||||||
begin
|
begin
|
||||||
if KeyComp('End') then begin
|
if KeyComp('End') then begin
|
||||||
if ((fToIdent<2) or (fLine[fToIdent-1]<>'@'))
|
if ((fToIdent<2) or (fLine[fToIdent-1]<>'@'))
|
||||||
@ -934,12 +954,15 @@ begin
|
|||||||
Result := tkKey;
|
Result := tkKey;
|
||||||
fRange := fRange - [rsAsm, rsAfterClassMembers];
|
fRange := fRange - [rsAsm, rsAfterClassMembers];
|
||||||
PasCodeFoldRange.BracketNestLevel := 0; // Reset in case of partial code
|
PasCodeFoldRange.BracketNestLevel := 0; // Reset in case of partial code
|
||||||
|
sl := fStringLen;
|
||||||
// there may be more than on block ending here
|
// there may be more than on block ending here
|
||||||
tfb := TopPascalCodeFoldBlockType;
|
tfb := TopPascalCodeFoldBlockType;
|
||||||
while (tfb in [cfbtIfThen]) do begin // no semicolon before end
|
fStringLen:=0;
|
||||||
|
while (tfb in [cfbtIfThen,cfbtForDo,cfbtWhileDo,cfbtWithDo]) do begin // no semicolon before end
|
||||||
EndPascalCodeFoldBlock(True);
|
EndPascalCodeFoldBlock(True);
|
||||||
tfb := TopPascalCodeFoldBlockType;
|
tfb := TopPascalCodeFoldBlockType;
|
||||||
end;
|
end;
|
||||||
|
fStringLen := sl;
|
||||||
if tfb = cfbtRecord then begin
|
if tfb = cfbtRecord then begin
|
||||||
EndPascalCodeFoldBlock;
|
EndPascalCodeFoldBlock;
|
||||||
end else if tfb = cfbtUnit then begin
|
end else if tfb = cfbtUnit then begin
|
||||||
@ -967,6 +990,11 @@ begin
|
|||||||
EndPascalCodeFoldBlock;
|
EndPascalCodeFoldBlock;
|
||||||
if TopPascalCodeFoldBlockType = cfbtProgram then
|
if TopPascalCodeFoldBlockType = cfbtProgram then
|
||||||
EndPascalCodeFoldBlock;
|
EndPascalCodeFoldBlock;
|
||||||
|
fStringLen:=0;
|
||||||
|
while (TopPascalCodeFoldBlockType in [{cfbtIfThen,}cfbtForDo,cfbtWhileDo,cfbtWithDo]) do begin // no semicolon after end
|
||||||
|
EndPascalCodeFoldBlock(True);
|
||||||
|
end;
|
||||||
|
fStringLen := sl;
|
||||||
end else if tfb = cfbtUnitSection then begin
|
end else if tfb = cfbtUnitSection then begin
|
||||||
EndPascalCodeFoldBlockLastLine;
|
EndPascalCodeFoldBlockLastLine;
|
||||||
if TopPascalCodeFoldBlockType = cfbtUnit then // "Unit".."end."
|
if TopPascalCodeFoldBlockType = cfbtUnit then // "Unit".."end."
|
||||||
@ -1104,7 +1132,11 @@ end;
|
|||||||
|
|
||||||
function TSynPasSyn.Func39: TtkTokenKind;
|
function TSynPasSyn.Func39: TtkTokenKind;
|
||||||
begin
|
begin
|
||||||
if KeyComp('For') then Result := tkKey else
|
if KeyComp('For') then begin
|
||||||
|
Result := tkKey;
|
||||||
|
StartPascalCodeFoldBlock(cfbtForDo , True);
|
||||||
|
end
|
||||||
|
else
|
||||||
if KeyComp('Shl') then Result := tkKey else Result := tkIdentifier;
|
if KeyComp('Shl') then Result := tkKey else Result := tkIdentifier;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -1129,8 +1161,8 @@ begin
|
|||||||
EndPascalCodeFoldBlock
|
EndPascalCodeFoldBlock
|
||||||
else
|
else
|
||||||
if TopPascalCodeFoldBlockType = cfbtCase then begin
|
if TopPascalCodeFoldBlockType = cfbtCase then begin
|
||||||
StartPascalCodeFoldBlock(cfbtCaseElse);
|
|
||||||
FTokenIsCaseLabel := True;
|
FTokenIsCaseLabel := True;
|
||||||
|
StartPascalCodeFoldBlock(cfbtCaseElse, True);
|
||||||
end;
|
end;
|
||||||
end
|
end
|
||||||
else if KeyComp('Var') then begin
|
else if KeyComp('Var') then begin
|
||||||
@ -1268,7 +1300,11 @@ end;
|
|||||||
function TSynPasSyn.Func57: TtkTokenKind;
|
function TSynPasSyn.Func57: TtkTokenKind;
|
||||||
begin
|
begin
|
||||||
if KeyComp('Goto') then Result := tkKey else
|
if KeyComp('Goto') then Result := tkKey else
|
||||||
if KeyComp('While') then Result := tkKey else
|
if KeyComp('While') then begin
|
||||||
|
Result := tkKey;
|
||||||
|
StartPascalCodeFoldBlock(cfbtWhileDo , True);
|
||||||
|
end
|
||||||
|
else
|
||||||
if KeyComp('Xor') then Result := tkKey else Result := tkIdentifier;
|
if KeyComp('Xor') then Result := tkKey else Result := tkIdentifier;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -1290,7 +1326,11 @@ end;
|
|||||||
|
|
||||||
function TSynPasSyn.Func60: TtkTokenKind;
|
function TSynPasSyn.Func60: TtkTokenKind;
|
||||||
begin
|
begin
|
||||||
if KeyComp('With') then Result := tkKey else Result := tkIdentifier;
|
if KeyComp('With') then begin
|
||||||
|
Result := tkKey;
|
||||||
|
StartPascalCodeFoldBlock(cfbtWithDo , True);
|
||||||
|
end
|
||||||
|
else Result := tkIdentifier;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TSynPasSyn.Func61: TtkTokenKind;
|
function TSynPasSyn.Func61: TtkTokenKind;
|
||||||
@ -2922,7 +2962,8 @@ begin
|
|||||||
if (tfb = cfbtClass) and (rsAfterClass in fRange) then
|
if (tfb = cfbtClass) and (rsAfterClass in fRange) then
|
||||||
EndPascalCodeFoldBlock(True);
|
EndPascalCodeFoldBlock(True);
|
||||||
|
|
||||||
while (tfb = cfbtIfThen) do begin
|
fStringLen:=0;
|
||||||
|
while (tfb in [cfbtIfThen,cfbtForDo,cfbtWhileDo,cfbtWithDo]) do begin
|
||||||
EndPascalCodeFoldBlock(True);
|
EndPascalCodeFoldBlock(True);
|
||||||
tfb := TopPascalCodeFoldBlockType;
|
tfb := TopPascalCodeFoldBlockType;
|
||||||
end;
|
end;
|
||||||
@ -4019,7 +4060,7 @@ var
|
|||||||
m: TSynCustomFoldConfigModes;
|
m: TSynCustomFoldConfigModes;
|
||||||
begin
|
begin
|
||||||
Result := inherited GetFoldConfigInstance(Index);
|
Result := inherited GetFoldConfigInstance(Index);
|
||||||
Result.Enabled := TPascalCodeFoldBlockType(Index) in [cfbtBeginEnd..cfbtIfThen];
|
Result.Enabled := TPascalCodeFoldBlockType(Index) in [cfbtBeginEnd..cfbtLastPublic];
|
||||||
|
|
||||||
m := [];
|
m := [];
|
||||||
if TPascalCodeFoldBlockType(Index) in PascalWordTripletRanges then
|
if TPascalCodeFoldBlockType(Index) in PascalWordTripletRanges then
|
||||||
@ -4028,7 +4069,7 @@ begin
|
|||||||
case TPascalCodeFoldBlockType(Index) of
|
case TPascalCodeFoldBlockType(Index) of
|
||||||
cfbtRegion, cfbtNestedComment, cfbtAnsiComment, cfbtBorCommand, cfbtSlashComment:
|
cfbtRegion, cfbtNestedComment, cfbtAnsiComment, cfbtBorCommand, cfbtSlashComment:
|
||||||
Result.SupportedModes := [fmFold, fmHide] + m;
|
Result.SupportedModes := [fmFold, fmHide] + m;
|
||||||
cfbtIfThen:
|
cfbtIfThen, cfbtForDo, cfbtWhileDo, cfbtWithDo:
|
||||||
Result.SupportedModes := m;
|
Result.SupportedModes := m;
|
||||||
cfbtFirstPrivate..high(TPascalCodeFoldBlockType):
|
cfbtFirstPrivate..high(TPascalCodeFoldBlockType):
|
||||||
Result.SupportedModes := [];
|
Result.SupportedModes := [];
|
||||||
@ -4038,7 +4079,7 @@ begin
|
|||||||
if not (TPascalCodeFoldBlockType(Index) in PascalNoOutlineRanges) then
|
if not (TPascalCodeFoldBlockType(Index) in PascalNoOutlineRanges) then
|
||||||
Result.SupportedModes := Result.SupportedModes + [fmOutline];
|
Result.SupportedModes := Result.SupportedModes + [fmOutline];
|
||||||
|
|
||||||
if (TPascalCodeFoldBlockType(Index) in [cfbtIfThen]) then
|
if (TPascalCodeFoldBlockType(Index) in [cfbtIfThen, cfbtForDo, cfbtWhileDo, cfbtWithDo]) then
|
||||||
m := [];
|
m := [];
|
||||||
if TPascalCodeFoldBlockType(Index) in [cfbtSlashComment] then
|
if TPascalCodeFoldBlockType(Index) in [cfbtSlashComment] then
|
||||||
Result.Modes := [fmFold, fmHide] + m
|
Result.Modes := [fmFold, fmHide] + m
|
||||||
@ -4071,7 +4112,7 @@ end;
|
|||||||
|
|
||||||
function TSynPasSyn.GetFoldConfigCount: Integer;
|
function TSynPasSyn.GetFoldConfigCount: Integer;
|
||||||
begin
|
begin
|
||||||
// excluded cfbtNone;
|
// excluded cfbtNone; // maybe ord(cfbtLastPublic)+1 ?
|
||||||
Result := ord(high(TPascalCodeFoldBlockType)) -
|
Result := ord(high(TPascalCodeFoldBlockType)) -
|
||||||
ord(low(TPascalCodeFoldBlockType))
|
ord(low(TPascalCodeFoldBlockType))
|
||||||
- 1;
|
- 1;
|
||||||
|
@ -1214,7 +1214,7 @@ begin
|
|||||||
{%region TEXT 1 -- [cfbtBeginEnd..cfbtNone], []}
|
{%region TEXT 1 -- [cfbtBeginEnd..cfbtNone], []}
|
||||||
PopPushBaseName('Text 1 -- [cfbtBeginEnd..cfbtNone], [], 0');
|
PopPushBaseName('Text 1 -- [cfbtBeginEnd..cfbtNone], [], 0');
|
||||||
SetLines(TestTextFoldInfo1);
|
SetLines(TestTextFoldInfo1);
|
||||||
EnableFolds([cfbtBeginEnd..cfbtNone], []);
|
EnableFolds([cfbtBeginEnd..cfbtNone]-[cfbtForDo,cfbtWhileDo,cfbtWithDo], []);
|
||||||
//DebugFoldInfo([]);
|
//DebugFoldInfo([]);
|
||||||
|
|
||||||
CheckFoldInfoCounts('', [], 0, [1, 1, 1, 1, 1, 3, 0, 1, 2, 1, 2, 2]);
|
CheckFoldInfoCounts('', [], 0, [1, 1, 1, 1, 1, 3, 0, 1, 2, 1, 2, 2]);
|
||||||
@ -1284,7 +1284,7 @@ begin
|
|||||||
{%region TEXT 1 -- [cfbtBeginEnd..cfbtNone], [] grp=1}
|
{%region TEXT 1 -- [cfbtBeginEnd..cfbtNone], [] grp=1}
|
||||||
PopPushBaseName('Text 1 -- [cfbtBeginEnd..cfbtNone], [], grp=1');
|
PopPushBaseName('Text 1 -- [cfbtBeginEnd..cfbtNone], [], grp=1');
|
||||||
SetLines(TestTextFoldInfo1);
|
SetLines(TestTextFoldInfo1);
|
||||||
EnableFolds([cfbtBeginEnd..cfbtNone], []);
|
EnableFolds([cfbtBeginEnd..cfbtNone]-[cfbtForDo,cfbtWhileDo,cfbtWithDo], []);
|
||||||
DebugFoldInfo([],1);
|
DebugFoldInfo([],1);
|
||||||
|
|
||||||
CheckFoldInfoCounts('', [], 1, [1, 1, 0, 1, 0, 1, 0, 1, 2, 1, 2, 2]);
|
CheckFoldInfoCounts('', [], 1, [1, 1, 0, 1, 0, 1, 0, 1, 2, 1, 2, 2]);
|
||||||
@ -1342,7 +1342,7 @@ begin
|
|||||||
{%region TEXT 1 -- [cfbtBeginEnd,cfbtIfDef], [] grp=1}
|
{%region TEXT 1 -- [cfbtBeginEnd,cfbtIfDef], [] grp=1}
|
||||||
PopPushBaseName('Text 1 -- [cfbtBeginEnd,cfbtIfDef], [], grp=4');
|
PopPushBaseName('Text 1 -- [cfbtBeginEnd,cfbtIfDef], [], grp=4');
|
||||||
SetLines(TestTextFoldInfo1);
|
SetLines(TestTextFoldInfo1);
|
||||||
EnableFolds([cfbtBeginEnd,cfbtIfDef], []);
|
EnableFolds([cfbtBeginEnd,cfbtIfDef]-[cfbtForDo,cfbtWhileDo,cfbtWithDo], []);
|
||||||
//DebugFoldInfo([],4);
|
//DebugFoldInfo([],4);
|
||||||
|
|
||||||
CheckFoldInfoCounts('', [], 1, [1, 1, 0, 1, 0, 1, 0, 1, 2, 1, 2, 2]);
|
CheckFoldInfoCounts('', [], 1, [1, 1, 0, 1, 0, 1, 0, 1, 2, 1, 2, 2]);
|
||||||
@ -1400,7 +1400,7 @@ begin
|
|||||||
{%region TEXT 1 -- [cfbtBeginEnd..cfbtNone], [sfaFold, sfaMultiLine]}
|
{%region TEXT 1 -- [cfbtBeginEnd..cfbtNone], [sfaFold, sfaMultiLine]}
|
||||||
PopPushBaseName('Text 1 -- [cfbtBeginEnd..cfbtNone], [sfaFold, sfaMultiLine], 0');
|
PopPushBaseName('Text 1 -- [cfbtBeginEnd..cfbtNone], [sfaFold, sfaMultiLine], 0');
|
||||||
SetLines(TestTextFoldInfo1);
|
SetLines(TestTextFoldInfo1);
|
||||||
EnableFolds([cfbtBeginEnd..cfbtNone], []);
|
EnableFolds([cfbtBeginEnd..cfbtNone]-[cfbtForDo,cfbtWhileDo,cfbtWithDo], []);
|
||||||
//DebugFoldInfo([sfaFold, sfaMultiLine]);
|
//DebugFoldInfo([sfaFold, sfaMultiLine]);
|
||||||
|
|
||||||
CheckFoldInfoCounts('', [sfaFold, sfaMultiLine], 0, [1, 1, 1, 1, 1, 1, 0, 1, 2, 1, 2, 0]);
|
CheckFoldInfoCounts('', [sfaFold, sfaMultiLine], 0, [1, 1, 1, 1, 1, 1, 0, 1, 2, 1, 2, 0]);
|
||||||
@ -1459,7 +1459,7 @@ begin
|
|||||||
{%region TEXT 1 -- [cfbtBeginEnd..cfbtNone], [sfaMarkup, sfaMultiLine]}
|
{%region TEXT 1 -- [cfbtBeginEnd..cfbtNone], [sfaMarkup, sfaMultiLine]}
|
||||||
PopPushBaseName('Text 1 -- [cfbtBeginEnd..cfbtNone]-cfbtIfDef, [sfaMarkup, sfaMultiLine], 0');
|
PopPushBaseName('Text 1 -- [cfbtBeginEnd..cfbtNone]-cfbtIfDef, [sfaMarkup, sfaMultiLine], 0');
|
||||||
SetLines(TestTextFoldInfo1);
|
SetLines(TestTextFoldInfo1);
|
||||||
EnableFolds([cfbtBeginEnd..cfbtNone]-[cfbtIfDef], []);
|
EnableFolds([cfbtBeginEnd..cfbtNone]-[cfbtIfDef]-[cfbtForDo,cfbtWhileDo,cfbtWithDo], []);
|
||||||
//DebugFoldInfo([sfaMarkup, sfaMultiLine]);
|
//DebugFoldInfo([sfaMarkup, sfaMultiLine]);
|
||||||
|
|
||||||
CheckFoldInfoCounts('', [sfaMarkup, sfaMultiLine], 0, [1, 1, 0, 1, 0, 1, 0, 1, 2, 1, 2, 0]);
|
CheckFoldInfoCounts('', [sfaMarkup, sfaMultiLine], 0, [1, 1, 0, 1, 0, 1, 0, 1, 2, 1, 2, 0]);
|
||||||
@ -1513,7 +1513,7 @@ begin
|
|||||||
{%region TEXT 1 -- [cfbtBeginEnd..cfbtNone], [sfaMarkup, sfaMultiLine]}
|
{%region TEXT 1 -- [cfbtBeginEnd..cfbtNone], [sfaMarkup, sfaMultiLine]}
|
||||||
PopPushBaseName('Text 1 -- [cfbtBeginEnd..cfbtNone], [sfaMarkup, sfaMultiLine], cfbtIfDef 0');
|
PopPushBaseName('Text 1 -- [cfbtBeginEnd..cfbtNone], [sfaMarkup, sfaMultiLine], cfbtIfDef 0');
|
||||||
SetLines(TestTextFoldInfo1);
|
SetLines(TestTextFoldInfo1);
|
||||||
EnableFolds([cfbtBeginEnd..cfbtNone], [], [cfbtIfDef]);
|
EnableFolds([cfbtBeginEnd..cfbtNone]-[cfbtForDo,cfbtWhileDo,cfbtWithDo], [], [cfbtIfDef]);
|
||||||
//DebugFoldInfo([sfaMarkup, sfaMultiLine]);
|
//DebugFoldInfo([sfaMarkup, sfaMultiLine]);
|
||||||
|
|
||||||
CheckFoldInfoCounts('', [sfaMarkup, sfaMultiLine], 0, [1, 1, 1, 1, 1, 3, 0, 1, 2, 1, 2, 0]);
|
CheckFoldInfoCounts('', [sfaMarkup, sfaMultiLine], 0, [1, 1, 1, 1, 1, 3, 0, 1, 2, 1, 2, 0]);
|
||||||
@ -1567,7 +1567,7 @@ begin
|
|||||||
{%region TEXT 1 -- [cfbtBeginEnd..cfbtNone]-[cfbtProcedure], [cfbtSlashComment]}
|
{%region TEXT 1 -- [cfbtBeginEnd..cfbtNone]-[cfbtProcedure], [cfbtSlashComment]}
|
||||||
PopPushBaseName('Text 1 -- [cfbtBeginEnd..cfbtNone]-[cfbtProcedure], [cfbtSlashComment], 0');
|
PopPushBaseName('Text 1 -- [cfbtBeginEnd..cfbtNone]-[cfbtProcedure], [cfbtSlashComment], 0');
|
||||||
SetLines(TestTextFoldInfo1);
|
SetLines(TestTextFoldInfo1);
|
||||||
EnableFolds([cfbtBeginEnd..cfbtNone]-[cfbtProcedure], [cfbtSlashComment]);
|
EnableFolds([cfbtBeginEnd..cfbtNone]-[cfbtProcedure]-[cfbtForDo,cfbtWhileDo,cfbtWithDo], [cfbtSlashComment]);
|
||||||
//DebugFoldInfo([]);
|
//DebugFoldInfo([]);
|
||||||
|
|
||||||
CheckFoldInfoCounts('', [], 0, [1, 1, 1, 1, 1, 3, 0, 1, 2, 1, 2, 2, 0]);
|
CheckFoldInfoCounts('', [], 0, [1, 1, 1, 1, 1, 3, 0, 1, 2, 1, 2, 2, 0]);
|
||||||
@ -1642,7 +1642,7 @@ begin
|
|||||||
{%region TEXT 2 -- [cfbtBeginEnd..cfbtNone], []}
|
{%region TEXT 2 -- [cfbtBeginEnd..cfbtNone], []}
|
||||||
PopPushBaseName('Text 2 -- [cfbtBeginEnd..cfbtNone], [], 0');
|
PopPushBaseName('Text 2 -- [cfbtBeginEnd..cfbtNone], [], 0');
|
||||||
SetLines(TestTextFoldInfo2);
|
SetLines(TestTextFoldInfo2);
|
||||||
EnableFolds([cfbtBeginEnd..cfbtNone], []);
|
EnableFolds([cfbtBeginEnd..cfbtNone]-[cfbtForDo,cfbtWhileDo,cfbtWithDo], []);
|
||||||
//DebugFoldInfo([]);
|
//DebugFoldInfo([]);
|
||||||
|
|
||||||
CheckFoldInfoCounts('', [], 0, [1, 1, 10, 2, 4, 5, 2, 3]);
|
CheckFoldInfoCounts('', [], 0, [1, 1, 10, 2, 4, 5, 2, 3]);
|
||||||
@ -1749,7 +1749,7 @@ begin
|
|||||||
{%region TEXT 3 -- [cfbtBeginEnd..cfbtNone], []}
|
{%region TEXT 3 -- [cfbtBeginEnd..cfbtNone], []}
|
||||||
PopPushBaseName('Text 3 -- [cfbtBeginEnd..cfbtNone], [], 0');
|
PopPushBaseName('Text 3 -- [cfbtBeginEnd..cfbtNone], [], 0');
|
||||||
SetLines(TestTextFoldInfo3);
|
SetLines(TestTextFoldInfo3);
|
||||||
EnableFolds([cfbtBeginEnd..cfbtNone], []);
|
EnableFolds([cfbtBeginEnd..cfbtNone]-[cfbtForDo,cfbtWhileDo,cfbtWithDo], []);
|
||||||
//DebugFoldInfo([]);
|
//DebugFoldInfo([]);
|
||||||
|
|
||||||
CheckFoldInfoCounts('', [], 0, [1, 1, 2, 1, 1, 1, 0, 3, 1, 3, 2]);
|
CheckFoldInfoCounts('', [], 0, [1, 1, 2, 1, 1, 1, 0, 3, 1, 3, 2]);
|
||||||
@ -1823,7 +1823,7 @@ begin
|
|||||||
{%region TEXT 4 -- [cfbtBeginEnd..cfbtNone], []}
|
{%region TEXT 4 -- [cfbtBeginEnd..cfbtNone], []}
|
||||||
PopPushBaseName('Text 4(1) -- [cfbtBeginEnd..cfbtNone], [], 0');
|
PopPushBaseName('Text 4(1) -- [cfbtBeginEnd..cfbtNone], [], 0');
|
||||||
SetLines(TestTextFoldInfo4(1));
|
SetLines(TestTextFoldInfo4(1));
|
||||||
EnableFolds([cfbtBeginEnd..cfbtNone], []);
|
EnableFolds([cfbtBeginEnd..cfbtNone]-[cfbtForDo,cfbtWhileDo,cfbtWithDo], []);
|
||||||
//DebugFoldInfo([]);
|
//DebugFoldInfo([]);
|
||||||
|
|
||||||
CheckFoldInfoCounts('', [], 0, [1, 1,3, 1, 2, 1, 3]);
|
CheckFoldInfoCounts('', [], 0, [1, 1,3, 1, 2, 1, 3]);
|
||||||
|
Loading…
Reference in New Issue
Block a user