codetools: fixed regression to jump between methods in implementation classes

git-svn-id: trunk@11850 -
This commit is contained in:
mattias 2007-08-23 14:27:29 +00:00
parent be22076c7a
commit ffc01c88f4
2 changed files with 21 additions and 13 deletions

View File

@ -3814,13 +3814,17 @@ function TPascalParserTool.FindFirstNodeOnSameLvl(
begin
Result:=StartNode;
if Result=nil then exit;
Result:=Result.Parent;
if Result=nil then exit;
while (Result.Desc in AllCodeSections) and (Result.PriorBrother<>nil) do
Result:=Result.PriorBrother;
while (Result<>nil) and (Result.FirstChild=nil) do
Result:=Result.NextBrother;
Result:=Result.FirstChild;
if Result.Parent=nil then begin
while Result.PriorBrother<>nil do
Result:=Result.PriorBrother;
end else begin
Result:=Result.Parent;
while (Result.Desc in AllCodeSections) and (Result.PriorBrother<>nil) do
Result:=Result.PriorBrother;
while (Result<>nil) and (Result.FirstChild=nil) do
Result:=Result.NextBrother;
Result:=Result.FirstChild;
end;
end;
function TPascalParserTool.FindNextNodeOnSameLvl(

View File

@ -1114,17 +1114,21 @@ begin
end;
end;
// next node
if (ANode.Desc=ctnTypeSection) and (ANode.FirstChild<>nil) then
if (ANode.Desc in [ctnTypeSection]+AllCodeSections)
and (ANode.FirstChild<>nil) then
ANode:=ANode.FirstChild
else if ANode.NextBrother<>nil then
ANode:=ANode.NextBrother
else begin
ANode:=ANode.NextSkipChilds;
// skip procs, const and var sections
while (ANode<>nil) and (ANode.Desc<>ctnTypeSection) do
ANode:=ANode.NextBrother;
if ANode<>nil then
ANode:=ANode.FirstChild;
repeat
ANode:=ANode.Parent;
if (ANode=nil) then exit;
if (not (ANode.Desc in [ctnTypeSection]+AllCodeSections)) then exit;
if ANode.NextBrother<>nil then
ANode:=ANode.NextBrother;
break;
until false;
end;
end;
end;