SynEdit: Fixed issue with fold/word-pair-markup "procedure xxx; forward" issue #0013487

git-svn-id: trunk@19412 -
This commit is contained in:
martin 2009-04-13 17:39:09 +00:00
parent a6e6bbabb7
commit 65af78ff54
2 changed files with 12 additions and 5 deletions

View File

@ -229,7 +229,7 @@ begin
if sfaOpen in Node1.FoldAction then begin
y1 := y;
Node2 := FindEndNode(Node1, y, i);
if (sfaInvalid in Node2.FoldAction) then
if (sfaInvalid in Node2.FoldAction) or not(sfaMarkup in Node2.FoldAction) then
exit;
y2 := y;
i2 := i;
@ -242,7 +242,7 @@ begin
y2 := y;
i2 := i;
Node1 := FindStartNode(Node2, y, i);
if (sfaInvalid in Node1.FoldAction) then
if (sfaInvalid in Node1.FoldAction) or not(sfaMarkup in Node1.FoldAction) then
exit;
y1 := y;
end;
@ -257,7 +257,8 @@ begin
Word2.Y := y2 + 1;
Word2.X := Node2.LogXStart + 1;
Word2.X2 := Node2.LogXEnd + 1;
if not(sfaInvalid in Node3.FoldAction) then begin
if (sfaMarkup in Node3.FoldAction) and not(sfaInvalid in Node3.FoldAction) then
begin
Word3 := Word2;
if i3 > i2 then begin
Word2 := Word1;

View File

@ -1329,8 +1329,11 @@ function TSynPasSyn.Func85: TtkTokenKind;
begin
if KeyComp('Forward') then begin
Result := tkKey;
if TopPascalCodeFoldBlockType = cfbtProcedure then
if TopPascalCodeFoldBlockType = cfbtProcedure then begin
EndCodeFoldBlock;
if FCatchNodeInfo then
exclude(FNodeInfoList[FNodeInfoCount-1].FoldAction, sfaMarkup);
end;
end else
if KeyComp('Library') then Result := tkKey else Result := tkIdentifier;
end;
@ -1425,8 +1428,11 @@ function TSynPasSyn.Func99: TtkTokenKind;
begin
if KeyComp('External') then begin
Result := tkKey;
if TopPascalCodeFoldBlockType = cfbtProcedure then
if TopPascalCodeFoldBlockType = cfbtProcedure then begin
EndCodeFoldBlock;
if FCatchNodeInfo then
exclude(FNodeInfoList[FNodeInfoCount-1].FoldAction, sfaMarkup);
end;
end else Result := tkIdentifier;
end;