mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-12-17 04:40:44 +01:00
SynEdit: fixed highlighting in "case else" block (don't assume any more case labels)
git-svn-id: trunk@34220 -
This commit is contained in:
parent
3c9ee8524f
commit
c98cb37eba
@ -129,6 +129,7 @@ type
|
|||||||
cfbtBorCommand, // { ... }
|
cfbtBorCommand, // { ... }
|
||||||
cfbtSlashComment, // //
|
cfbtSlashComment, // //
|
||||||
// Internal type / not configurable
|
// Internal type / not configurable
|
||||||
|
cfbtCaseElse, // "else" in case can have multiply statements
|
||||||
cfbtNone
|
cfbtNone
|
||||||
);
|
);
|
||||||
TPascalCodeFoldBlockTypes = set of TPascalCodeFoldBlockType;
|
TPascalCodeFoldBlockTypes = set of TPascalCodeFoldBlockType;
|
||||||
@ -176,6 +177,7 @@ const
|
|||||||
cfbtNestedComment, //cfbtBorCommand, // { ... }
|
cfbtNestedComment, //cfbtBorCommand, // { ... }
|
||||||
cfbtSlashComment, // //
|
cfbtSlashComment, // //
|
||||||
// Internal type / not configurable
|
// Internal type / not configurable
|
||||||
|
cfbtCaseElse,
|
||||||
cfbtNone
|
cfbtNone
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -1031,6 +1033,10 @@ begin
|
|||||||
EndPascalCodeFoldBlock;
|
EndPascalCodeFoldBlock;
|
||||||
if TopPascalCodeFoldBlockType in [cfbtProcedure] then
|
if TopPascalCodeFoldBlockType in [cfbtProcedure] then
|
||||||
EndPascalCodeFoldBlock;
|
EndPascalCodeFoldBlock;
|
||||||
|
end else if tfb in [cfbtCaseElse] then begin
|
||||||
|
EndPascalCodeFoldBlock;
|
||||||
|
EndPascalCodeFoldBlock; // must be cfbtCase
|
||||||
|
fRange := fRange - [rsAtCaseLabel];
|
||||||
end else if tfb in [cfbtCase] then begin
|
end else if tfb in [cfbtCase] then begin
|
||||||
EndPascalCodeFoldBlock;
|
EndPascalCodeFoldBlock;
|
||||||
fRange := fRange - [rsAtCaseLabel];
|
fRange := fRange - [rsAtCaseLabel];
|
||||||
@ -1176,8 +1182,11 @@ end;
|
|||||||
|
|
||||||
function TSynPasSyn.Func41: TtkTokenKind;
|
function TSynPasSyn.Func41: TtkTokenKind;
|
||||||
begin
|
begin
|
||||||
if KeyComp('Else') then
|
if KeyComp('Else') then begin
|
||||||
Result := tkKey
|
Result := tkKey;
|
||||||
|
if TopPascalCodeFoldBlockType = cfbtCase
|
||||||
|
then StartPascalCodeFoldBlock(cfbtCaseElse)
|
||||||
|
end
|
||||||
else if KeyComp('Var') then begin
|
else if KeyComp('Var') then begin
|
||||||
if (PasCodeFoldRange.BracketNestLevel = 0) and
|
if (PasCodeFoldRange.BracketNestLevel = 0) and
|
||||||
(TopPascalCodeFoldBlockType in
|
(TopPascalCodeFoldBlockType in
|
||||||
@ -3925,7 +3934,8 @@ function TSynPasSyn.GetFoldConfigCount: Integer;
|
|||||||
begin
|
begin
|
||||||
// excluded cfbtNone;
|
// excluded cfbtNone;
|
||||||
Result := ord(high(TPascalCodeFoldBlockType)) -
|
Result := ord(high(TPascalCodeFoldBlockType)) -
|
||||||
ord(low(TPascalCodeFoldBlockType));
|
ord(low(TPascalCodeFoldBlockType))
|
||||||
|
- 1;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TSynPasSyn.GetFoldConfigInternalCount: Integer;
|
function TSynPasSyn.GetFoldConfigInternalCount: Integer;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user