revert r28741 #34d7d7e235 because it breaks loading of saved fold info

git-svn-id: trunk@28742 -
This commit is contained in:
paul 2010-12-17 16:27:33 +00:00
parent 34d7d7e235
commit bf754531b7
3 changed files with 21 additions and 18 deletions

View File

@ -116,6 +116,7 @@ type
cfbtUnitSection,
cfbtProgram,
cfbtUnit,
cfbtRecord,
cfbtTry,
cfbtExcept,
cfbtRepeat,
@ -138,7 +139,7 @@ const
cfbtAll: TPascalCodeFoldBlockTypes =
[low(TPascalCodeFoldBlockType)..high(TPascalCodeFoldBlockType)];
PascalWordTrippletRanges: TPascalCodeFoldBlockTypes =
[cfbtBeginEnd, cfbtTopBeginEnd, cfbtProcedure, cfbtClass, cfbtProgram,
[cfbtBeginEnd, cfbtTopBeginEnd, cfbtProcedure, cfbtClass, cfbtProgram, cfbtRecord,
cfbtTry, cfbtExcept, cfbtRepeat, cfbtAsm, cfbtCase
];
@ -970,7 +971,9 @@ begin
{$IFDEF SYN_LAZARUS}
// there may be more than on block ending here
tfb := TopPascalCodeFoldBlockType;
if tfb = cfbtUnit then begin
if tfb = cfbtRecord then begin
EndPascalCodeFoldBlock;
end else if tfb = cfbtUnit then begin
EndPascalCodeFoldBlock;
end else if tfb = cfbtExcept then begin
EndPascalCodeFoldBlock;
@ -1283,12 +1286,8 @@ begin
end;
end
else if KeyComp('Record') then begin
StartPascalCodeFoldBlock(cfbtRecord);
Result := tkKey;
if (rsAfterEqualOrColon in fRange) and (PasCodeFoldRange.BracketNestLevel = 0)
then begin
fRange := fRange + [rsAtClass];
StartPascalCodeFoldBlock(cfbtClass);
end;
end
else if KeyComp('Array') then Result := tkKey
else if KeyComp('Try') then
@ -3698,14 +3697,14 @@ begin
cfbtVarType:
if FDividerDrawConfig[pddlVarGlobal].MaxDrawDepth > 0 then
exit(FDividerDrawConfig[pddlVarGlobal].TopSetting);
cfbtClass:
cfbtClass, cfbtRecord:
begin
if CheckFoldNestLevel(0, i + 1, [cfbtProcedure],
cfbtAll - [cfbtVarType, cfbtLocalVarType], c)
then t := pddlStructGlobal
else t := pddlStructLocal;
if CheckFoldNestLevel(FDividerDrawConfig[t].MaxDrawDepth - 1,
i + 1, [cfbtClass],
i + 1, [cfbtClass, cfbtRecord],
cfbtAll - [cfbtVarType, cfbtLocalVarType], c) then begin
if c = 0
then exit(FDividerDrawConfig[t].TopSetting)
@ -3775,7 +3774,7 @@ begin
Result.Enabled := TPascalCodeFoldBlockType(Index) in
[cfbtBeginEnd, cfbtTopBeginEnd, cfbtNestedComment,
cfbtProcedure, cfbtUses, cfbtLocalVarType, cfbtClass,
cfbtClassSection, cfbtRepeat, cfbtCase,
cfbtClassSection, cfbtRecord, cfbtRepeat, cfbtCase,
cfbtAsm, cfbtRegion];
if TPascalCodeFoldBlockType(Index) in
[cfbtRegion, cfbtNestedComment, cfbtAnsiComment, cfbtBorCommand, cfbtSlashComment]

View File

@ -418,7 +418,7 @@ type
const
(* When adding new entries, ensure that resourcestrings are re-assigned in InitLocale *)
EditorOptionsFoldInfoPas: Array [0..21] of TEditorOptionsFoldInfo
EditorOptionsFoldInfoPas: Array [0..22] of TEditorOptionsFoldInfo
= (
(Name: dlgFoldPasProcedure; Xml: 'Procedure';
Index: ord(cfbtProcedure); Enabled: True),
@ -454,6 +454,8 @@ const
Index: ord(cfbtClass); Enabled: True),
(Name: dlgFoldPasClassSection; Xml: 'ClassSection';
Index: ord(cfbtClassSection); Enabled: True),
(Name: dlgFoldPasRecord; Xml: 'Record';
Index: ord(cfbtRecord); Enabled: True),
(Name: dlgFoldPasIfDef; Xml: 'IfDef';
Index: ord(cfbtIfDef); Enabled: False),
@ -1505,12 +1507,13 @@ begin
EditorOptionsFoldInfoPas[13].Name := dlgFoldPasVarType;
EditorOptionsFoldInfoPas[14].Name := dlgFoldPasClass;
EditorOptionsFoldInfoPas[15].Name := dlgFoldPasClassSection;
EditorOptionsFoldInfoPas[16].Name := dlgFoldPasIfDef;
EditorOptionsFoldInfoPas[17].Name := dlgFoldPasUserRegion;
EditorOptionsFoldInfoPas[18].Name := dlgFoldPasAnsiComment;
EditorOptionsFoldInfoPas[19].Name := dlgFoldPasBorComment;
EditorOptionsFoldInfoPas[20].Name := dlgFoldPasSlashComment;
EditorOptionsFoldInfoPas[21].Name := dlgFoldPasNestedComment;
EditorOptionsFoldInfoPas[16].Name := dlgFoldPasRecord;
EditorOptionsFoldInfoPas[17].Name := dlgFoldPasIfDef;
EditorOptionsFoldInfoPas[18].Name := dlgFoldPasUserRegion;
EditorOptionsFoldInfoPas[19].Name := dlgFoldPasAnsiComment;
EditorOptionsFoldInfoPas[20].Name := dlgFoldPasBorComment;
EditorOptionsFoldInfoPas[21].Name := dlgFoldPasSlashComment;
EditorOptionsFoldInfoPas[22].Name := dlgFoldPasNestedComment;
EditorOptionsFoldInfoHTML[0].Name := dlgFoldHtmlNode;
EditorOptionsFoldInfoHTML[1].Name := dlgFoldHtmlComment;

View File

@ -1540,11 +1540,12 @@ resourcestring
dlgFoldPasUses = 'Uses';
dlgFoldPasVarType = 'Var/Type (global)';
dlgFoldLocalPasVarType = 'Var/Type (local)';
dlgFoldPasClass = 'Class/Object/Record';
dlgFoldPasClass = 'Class/Object';
dlgFoldPasClassSection = 'public/private';
dlgFoldPasUnitSection = 'Unit section';
dlgFoldPasProgram = 'Program';
dlgFoldPasUnit = 'Unit';
dlgFoldPasRecord = 'Record';
dlgFoldPasTry = 'Try';
dlgFoldPasExcept = 'Except/Finally';
dlgFoldPasRepeat = 'Repeat';