mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-10 10:16:04 +02:00
MG: jump point is now added if method jumping not revertable
git-svn-id: trunk@3469 -
This commit is contained in:
parent
199076ab2f
commit
fac2a16ff2
@ -202,7 +202,8 @@ type
|
||||
// method jumping
|
||||
function JumpToMethod(Code: TCodeBuffer; X,Y: integer;
|
||||
var NewCode: TCodeBuffer;
|
||||
var NewX, NewY, NewTopLine: integer): boolean;
|
||||
var NewX, NewY, NewTopLine: integer;
|
||||
var RevertableJump: boolean): boolean;
|
||||
|
||||
// find declaration
|
||||
function FindDeclaration(Code: TCodeBuffer; X,Y: integer;
|
||||
@ -619,7 +620,8 @@ begin
|
||||
end;
|
||||
|
||||
function TCodeToolManager.JumpToMethod(Code: TCodeBuffer; X,Y: integer;
|
||||
var NewCode: TCodeBuffer; var NewX, NewY, NewTopLine: integer): boolean;
|
||||
var NewCode: TCodeBuffer; var NewX, NewY, NewTopLine: integer;
|
||||
var RevertableJump: boolean): boolean;
|
||||
var
|
||||
CursorPos: TCodeXYPosition;
|
||||
NewPos: TCodeXYPosition;
|
||||
@ -636,7 +638,8 @@ begin
|
||||
writeln('TCodeToolManager.JumpToMethod B ',FCurCodeTool.Scanner<>nil);
|
||||
{$ENDIF}
|
||||
try
|
||||
Result:=FCurCodeTool.FindJumpPoint(CursorPos,NewPos,NewTopLine);
|
||||
Result:=FCurCodeTool.FindJumpPoint(CursorPos,NewPos,NewTopLine,
|
||||
RevertableJump);
|
||||
if Result then begin
|
||||
NewX:=NewPos.X;
|
||||
NewY:=NewPos.Y;
|
||||
|
@ -56,7 +56,8 @@ type
|
||||
const UpperProcName: string): TCodeTreeNode;
|
||||
public
|
||||
function FindJumpPoint(CursorPos: TCodeXYPosition;
|
||||
var NewPos: TCodeXYPosition; var NewTopLine: integer): boolean;
|
||||
var NewPos: TCodeXYPosition; var NewTopLine: integer;
|
||||
var RevertableJump: boolean): boolean;
|
||||
function FindJumpPointInProcNode(ProcNode: TCodeTreeNode;
|
||||
var NewPos: TCodeXYPosition; var NewTopLine: integer): boolean;
|
||||
function GatherProcNodes(StartNode: TCodeTreeNode;
|
||||
@ -136,7 +137,8 @@ begin
|
||||
end;
|
||||
|
||||
function TMethodJumpingCodeTool.FindJumpPoint(CursorPos: TCodeXYPosition;
|
||||
var NewPos: TCodeXYPosition; var NewTopLine: integer): boolean;
|
||||
var NewPos: TCodeXYPosition; var NewTopLine: integer;
|
||||
var RevertableJump: boolean): boolean;
|
||||
|
||||
const
|
||||
JumpToProcAttr = [phpInUpperCase,phpWithoutClassName,phpWithVarModifiers,
|
||||
@ -201,6 +203,7 @@ const
|
||||
Result:=JumpToCleanPos(ToProcNode.FirstChild.StartPos,
|
||||
ToProcNode.StartPos,NewPos,NewTopLine,false);
|
||||
end;
|
||||
RevertableJump:=true;
|
||||
end;
|
||||
end;
|
||||
|
||||
@ -260,6 +263,7 @@ var CursorNode, ClassNode, ProcNode, StartNode, TypeSectionNode,
|
||||
BodyAVLNode, DefAVLNode: TAVLTreeNode;
|
||||
begin
|
||||
Result:=false;
|
||||
RevertableJump:=false;
|
||||
NewPos:=CursorPos;
|
||||
// build code tree
|
||||
{$IFDEF CTDEBUG}
|
||||
|
Loading…
Reference in New Issue
Block a user