From bdc25905ce58cce9e6f8bda96f153c8ba74722fb Mon Sep 17 00:00:00 2001 From: mattias Date: Tue, 29 Jun 2010 13:47:48 +0000 Subject: [PATCH] IDE: code explorer: jump to proc header git-svn-id: trunk@26322 - --- ide/codeexplorer.pas | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/ide/codeexplorer.pas b/ide/codeexplorer.pas index 240d2eba60..282bcece77 100644 --- a/ide/codeexplorer.pas +++ b/ide/codeexplorer.pas @@ -572,7 +572,7 @@ begin if CurNode.StartPos>0 then begin case CurrentPage of cepCode: - if (CurNode.Desc in AllIdentifierDefinitions) + if (CurNode.Desc in AllIdentifierDefinitions+[ctnProcedure]) and (CurItem.GetNextMultiSelected=nil) then CanRename:=true; cepDirectives: @@ -772,7 +772,7 @@ begin ShowNode:=false; ShowChilds:=false; end; - + // category mode: put nodes in categories Category:=cecNone; if ShowNode @@ -1891,6 +1891,8 @@ var ACodeTool: TCodeTool; CurTreeView: TCustomTreeView; SrcEdit: TSourceEditorInterface; + NewNode: TCodeTreeNode; + p: LongInt; begin Result:=false; CurTreeView:=GetCurrentTreeView; @@ -1911,7 +1913,16 @@ begin ACodeTool:=nil; CodeToolBoss.Explore(CodeBuffer,ACodeTool,false); if ACodeTool=nil then exit; - if not ACodeTool.CleanPosToCaretAndTopLine(CurNode.StartPos,Caret,NewTopLine) + p:=CurNode.StartPos; + NewNode:=ACodeTool.FindDeepestNodeAtPos(p,false); + if NewNode<>nil then begin + if (NewNode.Desc=ctnProcedure) + and (NewNode.FirstChild<>nil) + and (NewNode.FirstChild.Desc=ctnProcedureHead) + and (NewNode.FirstChild.StartPos>p) then + p:=NewNode.FirstChild.StartPos; + end; + if not ACodeTool.CleanPosToCaretAndTopLine(p,Caret,NewTopLine) then exit; end; cepDirectives: