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 begin
Result:=StartNode; Result:=StartNode;
if Result=nil then exit; if Result=nil then exit;
Result:=Result.Parent; if Result.Parent=nil then begin
if Result=nil then exit; while Result.PriorBrother<>nil do
while (Result.Desc in AllCodeSections) and (Result.PriorBrother<>nil) do Result:=Result.PriorBrother;
Result:=Result.PriorBrother; end else begin
while (Result<>nil) and (Result.FirstChild=nil) do Result:=Result.Parent;
Result:=Result.NextBrother; while (Result.Desc in AllCodeSections) and (Result.PriorBrother<>nil) do
Result:=Result.FirstChild; Result:=Result.PriorBrother;
while (Result<>nil) and (Result.FirstChild=nil) do
Result:=Result.NextBrother;
Result:=Result.FirstChild;
end;
end; end;
function TPascalParserTool.FindNextNodeOnSameLvl( function TPascalParserTool.FindNextNodeOnSameLvl(

View File

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