View Issue Details

IDProjectCategoryView StatusLast Update
0013245LazarusIDEpublic2016-02-26 10:25
ReporterAlexander S. KleninAssigned ToOndrej Pokorny 
PrioritynormalSeveritytweakReproducibilityalways
Status resolvedResolutionfixed 
Product VersionProduct Build 
Target VersionFixed in Version1.7 (SVN) 
Summary0013245: Ctrl+click on a function/procedure should move to body, not declration
DescriptionAfter Ctrl+click on procedure/function name, cursor is moved to
a definition of that procedure/function.

It is usually more useful to move to a body (and Delphi does that).
If some developers prefer current behavior, it can me made an option
and/or moved to another shortcut, like Ctrl+Shift+click.

Currently Ctrl+Shift+click does both "select text" and "move to declaration",
which is nonsensical, so this shortcut can be considered free.
TagsNo tags attached.
Fixed in Revision51422
LazTarget-
Widgetset
Attached Files
  • JumpToMehodBody.patch (10,049 bytes)
    Index: ide/codetoolsoptions.pas
    ===================================================================
    --- ide/codetoolsoptions.pas	(revision 51418)
    +++ ide/codetoolsoptions.pas	(working copy)
    @@ -66,6 +66,7 @@
         FJumpCentered: boolean;
         FCursorBeyondEOL: boolean;
         FSkipForwardDeclarations: boolean;
    +    FJumpToMethodBody: boolean;
         
         // Define Templates
         FGlobalDefineTemplates: TDefineTemplate;
    @@ -152,7 +153,7 @@
         property CursorBeyondEOL: boolean
           read FCursorBeyondEOL write FCursorBeyondEOL;
         property SkipForwardDeclarations: boolean read FSkipForwardDeclarations write FSkipForwardDeclarations;
    -
    +    property JumpToMethodBody: boolean read FJumpToMethodBody write FJumpToMethodBody;
         // Define Templates
         property GlobalDefineTemplates: TDefineTemplate read FGlobalDefineTemplates;
         property DefinesEditMainSplitterTop: integer read FDefinesEditMainSplitterTop
    @@ -425,7 +426,9 @@
           'CodeToolsOptions/CursorBeyondEOL/Value',true);
         FSkipForwardDeclarations:=XMLConfig.GetValue(
           'CodeToolsOptions/SkipForwardDeclarations/Value',false);
    -      
    +    FJumpToMethodBody:=XMLConfig.GetValue(
    +      'CodeToolsOptions/JumpToMethodBody/Value',false);
    +
         // Define templates
         LoadGlobalDefineTemplates;
         FDefinesEditMainSplitterTop:=XMLConfig.GetValue(
    @@ -581,7 +584,8 @@
                                  FCursorBeyondEOL,true);
         XMLConfig.SetDeleteValue('CodeToolsOptions/SkipForwardDeclarations/Value',
                                  FSkipForwardDeclarations,false);
    -
    +    XMLConfig.SetDeleteValue('CodeToolsOptions/JumpToMethodBody/Value',
    +                             FJumpToMethodBody,false);
         // Define templates
         SaveGlobalDefineTemplates;
         XMLConfig.SetDeleteValue('CodeToolsOptions/DefinesEditMainSplitter/Top',
    @@ -778,6 +782,7 @@
         FAddInheritedCodeToOverrideMethod:=CodeToolsOpts.AddInheritedCodeToOverrideMethod;
         FCompleteProperties:=CodeToolsOpts.CompleteProperties;
         FSkipForwardDeclarations:=CodeToolsOpts.FSkipForwardDeclarations;
    +    FJumpToMethodBody:=CodeToolsOpts.FJumpToMethodBody;
     
         // define templates
         ClearGlobalDefineTemplates;
    @@ -925,6 +930,7 @@
         and (AddInheritedCodeToOverrideMethod=CodeToolsOpts.AddInheritedCodeToOverrideMethod)
         and (CompleteProperties=CodeToolsOpts.CompleteProperties)
         and (FSkipForwardDeclarations=CodeToolsOpts.FSkipForwardDeclarations)
    +    and (FJumpToMethodBody=CodeToolsOpts.FJumpToMethodBody)
         
         // define templates
         and (FGlobalDefineTemplates.IsEqual(
    Index: ide/frames/codetools_general_options.lfm
    ===================================================================
    --- ide/frames/codetools_general_options.lfm	(revision 51418)
    +++ ide/frames/codetools_general_options.lfm	(working copy)
    @@ -13,7 +13,7 @@
         AnchorSideTop.Side = asrBottom
         AnchorSideRight.Side = asrBottom
         Left = 0
    -    Height = 127
    +    Height = 129
         Top = 6
         Width = 552
         Align = alTop
    @@ -22,7 +22,7 @@
         Caption = 'JumpingGroupBox'
         ChildSizing.LeftRightSpacing = 6
         ChildSizing.TopBottomSpacing = 6
    -    ClientHeight = 108
    +    ClientHeight = 109
         ClientWidth = 548
         TabOrder = 0
         object AdjustTopLineDueToCommentCheckBox: TCheckBox
    @@ -29,9 +29,9 @@
           AnchorSideLeft.Control = JumpingGroupBox
           AnchorSideTop.Control = JumpingGroupBox
           Left = 6
    -      Height = 24
    +      Height = 19
           Top = 6
    -      Width = 297
    +      Width = 238
           Caption = 'AdjustTopLineDueToCommentCheckBox'
           TabOrder = 0
         end
    @@ -40,9 +40,9 @@
           AnchorSideTop.Control = AdjustTopLineDueToCommentCheckBox
           AnchorSideTop.Side = asrBottom
           Left = 6
    -      Height = 24
    -      Top = 30
    -      Width = 191
    +      Height = 19
    +      Top = 25
    +      Width = 149
           Caption = 'JumpCenteredCheckBox'
           TabOrder = 1
         end
    @@ -51,9 +51,9 @@
           AnchorSideTop.Control = JumpCenteredCheckBox
           AnchorSideTop.Side = asrBottom
           Left = 6
    -      Height = 24
    -      Top = 54
    -      Width = 213
    +      Height = 19
    +      Top = 44
    +      Width = 168
           Caption = 'CursorBeyondEOLCheckBox'
           TabOrder = 2
         end
    @@ -62,17 +62,25 @@
           AnchorSideTop.Control = CursorBeyondEOLCheckBox
           AnchorSideTop.Side = asrBottom
           Left = 6
    -      Height = 24
    -      Top = 78
    -      Width = 263
    +      Height = 19
    +      Top = 63
    +      Width = 202
           Caption = 'SkipForwardDeclarationsCheckBox'
           TabOrder = 3
         end
    +    object JumpToMethodBodyCheckBox: TCheckBox
    +      Left = 6
    +      Height = 19
    +      Top = 84
    +      Width = 184
    +      Caption = 'JumpToMethodBodyCheckBox'
    +      TabOrder = 4
    +    end
       end
       object IndentationGroupBox: TGroupBox
         Left = 0
    -    Height = 154
    -    Top = 139
    +    Height = 151
    +    Top = 141
         Width = 552
         Align = alTop
         AutoSize = True
    @@ -80,7 +88,7 @@
         Caption = 'IndentationGroupBox'
         ChildSizing.LeftRightSpacing = 6
         ChildSizing.TopBottomSpacing = 6
    -    ClientHeight = 135
    +    ClientHeight = 131
         ClientWidth = 548
         TabOrder = 1
         object IndentFileLabel: TLabel
    @@ -87,9 +95,9 @@
           AnchorSideLeft.Control = IndentationGroupBox
           AnchorSideTop.Side = asrCenter
           Left = 6
    -      Height = 17
    +      Height = 15
           Top = 107
    -      Width = 104
    +      Width = 80
           BorderSpacing.Left = 6
           Caption = 'IndentFileLabel'
           ParentColor = False
    @@ -99,9 +107,9 @@
           AnchorSideTop.Control = IndentOnPasteCheckBox
           AnchorSideTop.Side = asrBottom
           Left = 6
    -      Height = 24
    -      Top = 71
    -      Width = 249
    +      Height = 19
    +      Top = 59
    +      Width = 193
           Caption = 'IndentContextSensitiveCheckBox'
           TabOrder = 2
         end
    @@ -110,9 +118,9 @@
           AnchorSideTop.Control = GeneralAutoIndent
           AnchorSideTop.Side = asrBottom
           Left = 6
    -      Height = 24
    -      Top = 23
    -      Width = 221
    +      Height = 19
    +      Top = 21
    +      Width = 173
           Caption = 'IndentOnLineBreakCheckBox'
           OnChange = IndentOnLineBreakCheckBoxChange
           TabOrder = 0
    @@ -122,9 +130,9 @@
           AnchorSideTop.Control = IndentOnLineBreakCheckBox
           AnchorSideTop.Side = asrBottom
           Left = 6
    -      Height = 24
    -      Top = 47
    -      Width = 192
    +      Height = 19
    +      Top = 40
    +      Width = 150
           Caption = 'IndentOnPasteCheckBox'
           OnChange = IndentOnPasteCheckBoxChange
           TabOrder = 1
    @@ -132,9 +140,9 @@
         object GeneralAutoIndent: TLabel
           Cursor = crHandPoint
           Left = 6
    -      Height = 17
    +      Height = 15
           Top = 6
    -      Width = 128
    +      Width = 100
           Caption = 'GeneralAutoIndent'
           Font.Color = clBlue
           ParentColor = False
    @@ -149,10 +157,10 @@
           AnchorSideTop.Side = asrCenter
           AnchorSideRight.Control = IndentationGroupBox
           AnchorSideRight.Side = asrBottom
    -      Left = 116
    -      Height = 27
    +      Left = 92
    +      Height = 23
           Top = 102
    -      Width = 426
    +      Width = 450
           FilterIndex = 0
           HideDirectories = False
           ButtonWidth = 50
    Index: ide/frames/codetools_general_options.pas
    ===================================================================
    --- ide/frames/codetools_general_options.pas	(revision 51418)
    +++ ide/frames/codetools_general_options.pas	(working copy)
    @@ -45,6 +45,7 @@
         JumpCenteredCheckBox: TCheckBox;
         JumpingGroupBox: TGroupBox;
         IndentFileLabel: TLabel;
    +    JumpToMethodBodyCheckBox: TCheckBox;
         SkipForwardDeclarationsCheckBox: TCheckBox;
         procedure GeneralAutoIndentClick(Sender: TObject);
         procedure GeneralAutoIndentMouseEnter(Sender: TObject);
    @@ -120,6 +121,7 @@
       JumpCenteredCheckBox.Caption:=dlgcentercursorline;
       CursorBeyondEOLCheckBox.Caption:=dlgcursorbeyondeol;
       SkipForwardDeclarationsCheckBox.Caption:=dlgSkipForwardClassDeclarations;
    +  JumpToMethodBodyCheckBox.Caption := dlgJumpToMethodBody;
     
       IndentationGroupBox.Caption:=lisIndentationForPascalSources;
       GeneralAutoIndent.Caption:=lisSetupDefaultIndentation;
    @@ -142,6 +144,7 @@
         JumpCenteredCheckBox.Checked := JumpCentered;
         CursorBeyondEOLCheckBox.Checked := CursorBeyondEOL;
         SkipForwardDeclarationsCheckBox.Checked := SkipForwardDeclarations;
    +    JumpToMethodBodyCheckBox.Checked := JumpToMethodBody;
         IndentOnLineBreakCheckBox.Checked:=IndentOnLineBreak;
         IndentOnPasteCheckBox.Checked:=IndentOnPaste;
         IndentFileEdit.Text:=IndentationFileName;
    @@ -158,6 +161,7 @@
         JumpCentered := JumpCenteredCheckBox.Checked;
         CursorBeyondEOL := CursorBeyondEOLCheckBox.Checked;
         SkipForwardDeclarations := SkipForwardDeclarationsCheckBox.Checked;
    +    JumpToMethodBody:=JumpToMethodBodyCheckBox.Checked;
         IndentOnLineBreak:=IndentOnLineBreakCheckBox.Checked;
         IndentOnPaste:=IndentOnPasteCheckBox.Checked;
         IndentationFileName:=IndentFileEdit.Text;
    Index: ide/lazarusidestrconsts.pas
    ===================================================================
    --- ide/lazarusidestrconsts.pas	(revision 51418)
    +++ ide/lazarusidestrconsts.pas	(working copy)
    @@ -2094,6 +2094,7 @@
       dlgCenterCursorLine = 'Center cursor line';
       dlgCursorBeyondEOL = 'Cursor beyond EOL';
       dlgSkipForwardClassDeclarations = 'Skip forward class declarations';
    +  dlgJumpToMethodBody = 'Jump directly to method body';
       dlgInsertClassParts = 'Insert class parts';
       lisClassCompletion = 'Class Completion';
       dlgAlphabetically = 'Alphabetically';
    Index: ide/main.pp
    ===================================================================
    --- ide/main.pp	(revision 51418)
    +++ ide/main.pp	(working copy)
    @@ -9616,6 +9616,8 @@
         //debugln(['TMainIDE.DoFindDeclarationAtCaret ',NewSource.Filename,' NewX=',Newx,',y=',NewY,' ',NewTopLine]);
         DoJumpToCodePosition(ActiveSrcEdit, ActiveUnitInfo,
           NewSource, NewX, NewY, NewTopLine, [jfAddJumpPoint, jfFocusEditor]);
    +    if CodeToolsOpts.JumpToMethodBody then
    +      DoJumpToOtherProcedureSection;
       end else begin
         DoJumpToCodeToolBossError;
       end;
    
    JumpToMehodBody.patch (10,049 bytes)

Relationships

has duplicate 0026328 resolvedJuha Manninen Ctrl+Click on the procedure jumps to declaration (instead of implementation) 
has duplicate 0029498 closedOndrej Pokorny [Request] Method jumping 
has duplicate 0029518 resolvedJuha Manninen Find Declaration of... Do not jump direct to procedure 
related to 0029730 closedOndrej Pokorny Ctrl-click on local variable jumps to method declaration if "Jump directly to method body" is enabled 

Activities

Vincent Snijders

2009-02-26 19:22

manager   ~0025767

Isn't the definition the same as the declaration?

I can imagine that some people want to jump to the implementation, but I don't know what to do with jumping to the implementation of property or variable, so then you would fall back to the more common jump to declaration.

Alexander S. Klenin

2009-04-17 14:21

developer   ~0026816

I mixed up with C++ terminology.
Yes, I meant 'jump to the body instead of the definition'.
Of course, ctrl+click on properties should work as currently.

Summary and description updated.
On related note, should this follow the current "Skip forward declaration" setting or should a new setting be created?

Alexander S. Klenin

2010-03-23 05:18

developer   ~0035959

Procedure declarations are always 'forward', so this is not an issue.
That setting concerns class declarations.

Flávio Etrusco (notifications not working)

2010-03-23 06:01

developer   ~0035961

Last edited: 2010-03-23 06:03

I'm lost. Can you draw it to me? ;)
Do you mean 'methods' are always 'forward'? Which setting?

Alexander S. Klenin

2010-03-23 08:44

developer   ~0035965

"Skip forward declaration" setting was introduced so that given code

type
  TMyClass = class; //1
... many lines ...
  TMyClass = class //2
  end;

Ctrl+click on TMyClass moved to the line with comment //2, not the line with //1
(A have no idea why somebody would want to this setting off).

This does not have any impact on functions/procedures.
It works for procedures, but not for methods. I never actually tried it for classes/records/objects, as these are more rare.

Alexander S. Klenin

2010-03-23 15:14

developer   ~0035978

We probably should ask Mattias about his intent,
but for me "Skip forward declaration" setting does NOT work neither for
procedures, nor for methods, only for classes.
The implementation was meant for procedures (I added the configuration option when Mattias implemented it), and in a basic check it's still working.
Testing now I also found that forward class declarations are always skipped, independent of the setting.

Alexander S. Klenin

2010-03-26 17:20

developer   ~0036117

Last edited: 2010-03-26 17:20

>The implementation was meant for procedures

You added the option in the issue 0013814,
and Mattias implemented the check in issue 0013146
(that was a feature request by me).

I might completely misunderstand my own feature request,
but it seems to me that it talks about classes, not procedures ;-)

>Testing now I also found that forward class declarations
>are always skipped, independent of the setting.

You might want to look at the last note in issue 0013146.

Ondrej Pokorny

2016-01-24 18:16

developer   ~0089319

@Balasz:

It shouldn't be that hard to do it for you - just consecutively call the 2 codetools functions. Also make sure that no error/jump is done for abstract methods, properties etc. Also don't forget to make an option in IDE Options -> CodeTools -> General -> Jumping right under "Skip forward class declarations" because I (and there may be also others) like it the way it is now :)

Balázs Székely

2016-01-26 12:16

developer   ~0089397

This is so simple, I wonder why wasn't implemented sooner. :)
To enable this option please check:
IDE Options -> CodeTools -> General -> Jump directly to method body

Balázs Székely

2016-01-26 12:16

developer  

JumpToMehodBody.patch (10,049 bytes)
Index: ide/codetoolsoptions.pas
===================================================================
--- ide/codetoolsoptions.pas	(revision 51418)
+++ ide/codetoolsoptions.pas	(working copy)
@@ -66,6 +66,7 @@
     FJumpCentered: boolean;
     FCursorBeyondEOL: boolean;
     FSkipForwardDeclarations: boolean;
+    FJumpToMethodBody: boolean;
     
     // Define Templates
     FGlobalDefineTemplates: TDefineTemplate;
@@ -152,7 +153,7 @@
     property CursorBeyondEOL: boolean
       read FCursorBeyondEOL write FCursorBeyondEOL;
     property SkipForwardDeclarations: boolean read FSkipForwardDeclarations write FSkipForwardDeclarations;
-
+    property JumpToMethodBody: boolean read FJumpToMethodBody write FJumpToMethodBody;
     // Define Templates
     property GlobalDefineTemplates: TDefineTemplate read FGlobalDefineTemplates;
     property DefinesEditMainSplitterTop: integer read FDefinesEditMainSplitterTop
@@ -425,7 +426,9 @@
       'CodeToolsOptions/CursorBeyondEOL/Value',true);
     FSkipForwardDeclarations:=XMLConfig.GetValue(
       'CodeToolsOptions/SkipForwardDeclarations/Value',false);
-      
+    FJumpToMethodBody:=XMLConfig.GetValue(
+      'CodeToolsOptions/JumpToMethodBody/Value',false);
+
     // Define templates
     LoadGlobalDefineTemplates;
     FDefinesEditMainSplitterTop:=XMLConfig.GetValue(
@@ -581,7 +584,8 @@
                              FCursorBeyondEOL,true);
     XMLConfig.SetDeleteValue('CodeToolsOptions/SkipForwardDeclarations/Value',
                              FSkipForwardDeclarations,false);
-
+    XMLConfig.SetDeleteValue('CodeToolsOptions/JumpToMethodBody/Value',
+                             FJumpToMethodBody,false);
     // Define templates
     SaveGlobalDefineTemplates;
     XMLConfig.SetDeleteValue('CodeToolsOptions/DefinesEditMainSplitter/Top',
@@ -778,6 +782,7 @@
     FAddInheritedCodeToOverrideMethod:=CodeToolsOpts.AddInheritedCodeToOverrideMethod;
     FCompleteProperties:=CodeToolsOpts.CompleteProperties;
     FSkipForwardDeclarations:=CodeToolsOpts.FSkipForwardDeclarations;
+    FJumpToMethodBody:=CodeToolsOpts.FJumpToMethodBody;
 
     // define templates
     ClearGlobalDefineTemplates;
@@ -925,6 +930,7 @@
     and (AddInheritedCodeToOverrideMethod=CodeToolsOpts.AddInheritedCodeToOverrideMethod)
     and (CompleteProperties=CodeToolsOpts.CompleteProperties)
     and (FSkipForwardDeclarations=CodeToolsOpts.FSkipForwardDeclarations)
+    and (FJumpToMethodBody=CodeToolsOpts.FJumpToMethodBody)
     
     // define templates
     and (FGlobalDefineTemplates.IsEqual(
Index: ide/frames/codetools_general_options.lfm
===================================================================
--- ide/frames/codetools_general_options.lfm	(revision 51418)
+++ ide/frames/codetools_general_options.lfm	(working copy)
@@ -13,7 +13,7 @@
     AnchorSideTop.Side = asrBottom
     AnchorSideRight.Side = asrBottom
     Left = 0
-    Height = 127
+    Height = 129
     Top = 6
     Width = 552
     Align = alTop
@@ -22,7 +22,7 @@
     Caption = 'JumpingGroupBox'
     ChildSizing.LeftRightSpacing = 6
     ChildSizing.TopBottomSpacing = 6
-    ClientHeight = 108
+    ClientHeight = 109
     ClientWidth = 548
     TabOrder = 0
     object AdjustTopLineDueToCommentCheckBox: TCheckBox
@@ -29,9 +29,9 @@
       AnchorSideLeft.Control = JumpingGroupBox
       AnchorSideTop.Control = JumpingGroupBox
       Left = 6
-      Height = 24
+      Height = 19
       Top = 6
-      Width = 297
+      Width = 238
       Caption = 'AdjustTopLineDueToCommentCheckBox'
       TabOrder = 0
     end
@@ -40,9 +40,9 @@
       AnchorSideTop.Control = AdjustTopLineDueToCommentCheckBox
       AnchorSideTop.Side = asrBottom
       Left = 6
-      Height = 24
-      Top = 30
-      Width = 191
+      Height = 19
+      Top = 25
+      Width = 149
       Caption = 'JumpCenteredCheckBox'
       TabOrder = 1
     end
@@ -51,9 +51,9 @@
       AnchorSideTop.Control = JumpCenteredCheckBox
       AnchorSideTop.Side = asrBottom
       Left = 6
-      Height = 24
-      Top = 54
-      Width = 213
+      Height = 19
+      Top = 44
+      Width = 168
       Caption = 'CursorBeyondEOLCheckBox'
       TabOrder = 2
     end
@@ -62,17 +62,25 @@
       AnchorSideTop.Control = CursorBeyondEOLCheckBox
       AnchorSideTop.Side = asrBottom
       Left = 6
-      Height = 24
-      Top = 78
-      Width = 263
+      Height = 19
+      Top = 63
+      Width = 202
       Caption = 'SkipForwardDeclarationsCheckBox'
       TabOrder = 3
     end
+    object JumpToMethodBodyCheckBox: TCheckBox
+      Left = 6
+      Height = 19
+      Top = 84
+      Width = 184
+      Caption = 'JumpToMethodBodyCheckBox'
+      TabOrder = 4
+    end
   end
   object IndentationGroupBox: TGroupBox
     Left = 0
-    Height = 154
-    Top = 139
+    Height = 151
+    Top = 141
     Width = 552
     Align = alTop
     AutoSize = True
@@ -80,7 +88,7 @@
     Caption = 'IndentationGroupBox'
     ChildSizing.LeftRightSpacing = 6
     ChildSizing.TopBottomSpacing = 6
-    ClientHeight = 135
+    ClientHeight = 131
     ClientWidth = 548
     TabOrder = 1
     object IndentFileLabel: TLabel
@@ -87,9 +95,9 @@
       AnchorSideLeft.Control = IndentationGroupBox
       AnchorSideTop.Side = asrCenter
       Left = 6
-      Height = 17
+      Height = 15
       Top = 107
-      Width = 104
+      Width = 80
       BorderSpacing.Left = 6
       Caption = 'IndentFileLabel'
       ParentColor = False
@@ -99,9 +107,9 @@
       AnchorSideTop.Control = IndentOnPasteCheckBox
       AnchorSideTop.Side = asrBottom
       Left = 6
-      Height = 24
-      Top = 71
-      Width = 249
+      Height = 19
+      Top = 59
+      Width = 193
       Caption = 'IndentContextSensitiveCheckBox'
       TabOrder = 2
     end
@@ -110,9 +118,9 @@
       AnchorSideTop.Control = GeneralAutoIndent
       AnchorSideTop.Side = asrBottom
       Left = 6
-      Height = 24
-      Top = 23
-      Width = 221
+      Height = 19
+      Top = 21
+      Width = 173
       Caption = 'IndentOnLineBreakCheckBox'
       OnChange = IndentOnLineBreakCheckBoxChange
       TabOrder = 0
@@ -122,9 +130,9 @@
       AnchorSideTop.Control = IndentOnLineBreakCheckBox
       AnchorSideTop.Side = asrBottom
       Left = 6
-      Height = 24
-      Top = 47
-      Width = 192
+      Height = 19
+      Top = 40
+      Width = 150
       Caption = 'IndentOnPasteCheckBox'
       OnChange = IndentOnPasteCheckBoxChange
       TabOrder = 1
@@ -132,9 +140,9 @@
     object GeneralAutoIndent: TLabel
       Cursor = crHandPoint
       Left = 6
-      Height = 17
+      Height = 15
       Top = 6
-      Width = 128
+      Width = 100
       Caption = 'GeneralAutoIndent'
       Font.Color = clBlue
       ParentColor = False
@@ -149,10 +157,10 @@
       AnchorSideTop.Side = asrCenter
       AnchorSideRight.Control = IndentationGroupBox
       AnchorSideRight.Side = asrBottom
-      Left = 116
-      Height = 27
+      Left = 92
+      Height = 23
       Top = 102
-      Width = 426
+      Width = 450
       FilterIndex = 0
       HideDirectories = False
       ButtonWidth = 50
Index: ide/frames/codetools_general_options.pas
===================================================================
--- ide/frames/codetools_general_options.pas	(revision 51418)
+++ ide/frames/codetools_general_options.pas	(working copy)
@@ -45,6 +45,7 @@
     JumpCenteredCheckBox: TCheckBox;
     JumpingGroupBox: TGroupBox;
     IndentFileLabel: TLabel;
+    JumpToMethodBodyCheckBox: TCheckBox;
     SkipForwardDeclarationsCheckBox: TCheckBox;
     procedure GeneralAutoIndentClick(Sender: TObject);
     procedure GeneralAutoIndentMouseEnter(Sender: TObject);
@@ -120,6 +121,7 @@
   JumpCenteredCheckBox.Caption:=dlgcentercursorline;
   CursorBeyondEOLCheckBox.Caption:=dlgcursorbeyondeol;
   SkipForwardDeclarationsCheckBox.Caption:=dlgSkipForwardClassDeclarations;
+  JumpToMethodBodyCheckBox.Caption := dlgJumpToMethodBody;
 
   IndentationGroupBox.Caption:=lisIndentationForPascalSources;
   GeneralAutoIndent.Caption:=lisSetupDefaultIndentation;
@@ -142,6 +144,7 @@
     JumpCenteredCheckBox.Checked := JumpCentered;
     CursorBeyondEOLCheckBox.Checked := CursorBeyondEOL;
     SkipForwardDeclarationsCheckBox.Checked := SkipForwardDeclarations;
+    JumpToMethodBodyCheckBox.Checked := JumpToMethodBody;
     IndentOnLineBreakCheckBox.Checked:=IndentOnLineBreak;
     IndentOnPasteCheckBox.Checked:=IndentOnPaste;
     IndentFileEdit.Text:=IndentationFileName;
@@ -158,6 +161,7 @@
     JumpCentered := JumpCenteredCheckBox.Checked;
     CursorBeyondEOL := CursorBeyondEOLCheckBox.Checked;
     SkipForwardDeclarations := SkipForwardDeclarationsCheckBox.Checked;
+    JumpToMethodBody:=JumpToMethodBodyCheckBox.Checked;
     IndentOnLineBreak:=IndentOnLineBreakCheckBox.Checked;
     IndentOnPaste:=IndentOnPasteCheckBox.Checked;
     IndentationFileName:=IndentFileEdit.Text;
Index: ide/lazarusidestrconsts.pas
===================================================================
--- ide/lazarusidestrconsts.pas	(revision 51418)
+++ ide/lazarusidestrconsts.pas	(working copy)
@@ -2094,6 +2094,7 @@
   dlgCenterCursorLine = 'Center cursor line';
   dlgCursorBeyondEOL = 'Cursor beyond EOL';
   dlgSkipForwardClassDeclarations = 'Skip forward class declarations';
+  dlgJumpToMethodBody = 'Jump directly to method body';
   dlgInsertClassParts = 'Insert class parts';
   lisClassCompletion = 'Class Completion';
   dlgAlphabetically = 'Alphabetically';
Index: ide/main.pp
===================================================================
--- ide/main.pp	(revision 51418)
+++ ide/main.pp	(working copy)
@@ -9616,6 +9616,8 @@
     //debugln(['TMainIDE.DoFindDeclarationAtCaret ',NewSource.Filename,' NewX=',Newx,',y=',NewY,' ',NewTopLine]);
     DoJumpToCodePosition(ActiveSrcEdit, ActiveUnitInfo,
       NewSource, NewX, NewY, NewTopLine, [jfAddJumpPoint, jfFocusEditor]);
+    if CodeToolsOpts.JumpToMethodBody then
+      DoJumpToOtherProcedureSection;
   end else begin
     DoJumpToCodeToolBossError;
   end;
JumpToMehodBody.patch (10,049 bytes)

Ondrej Pokorny

2016-01-26 14:38

developer   ~0089404

Balász, I don't like that there are 2 jumps. There should be only one jump to the method body if it is found.

You should omit the DoJumpToCodePosition call before DoJumpToOtherProcedureSection.

Balázs Székely

2016-01-26 14:54

developer   ~0089405

@Ondrej

If I omit DoJumpToCodePosition nothing happens.

Ondrej Pokorny

2016-01-26 14:56

developer   ~0089406

>> If I omit DoJumpToCodePosition nothing happens.

Do it so that something happens...

Ondrej Pokorny

2016-01-26 17:56

developer   ~0089411

>> I don't like that there are 2 jumps. There should be only one jump to the method body if it is found.

This is especially needed when jumping to method body that is in a different file as the method declaration. I fixed this.

Please test.

Balázs Székely

2016-01-26 19:46

developer   ~0089414

@Ondrej you must slow down. I came up with something similar, but I'm operating at normal speed. :) Anyway it works fine and I'm happy because it was long needed feature.

Ondrej Pokorny

2016-01-26 20:43

developer   ~0089416

Yes, sorry - I should have let you do it. Anyway thanks for the basic patch :)

Issue History

Date Modified Username Field Change
2009-02-26 15:50 Alexander S. Klenin New Issue
2009-02-26 19:22 Vincent Snijders Note Added: 0025767
2009-04-16 14:49 Vincent Snijders LazTarget => post 1.2
2009-04-16 14:49 Vincent Snijders Status new => acknowledged
2009-04-17 14:21 Alexander S. Klenin Note Added: 0026816
2009-04-17 14:21 Alexander S. Klenin Summary Ctrl+click on a function/procedure should move to definition, not declration => Ctrl+click on a function/procedure should move to body, not declration
2009-04-17 14:21 Alexander S. Klenin Description Updated
2010-03-23 03:15 Flávio Etrusco (notifications not working) Note Added: 0035954
2010-03-23 05:18 Alexander S. Klenin Note Added: 0035959
2010-03-23 06:01 Flávio Etrusco (notifications not working) Note Added: 0035961
2010-03-23 06:02 Flávio Etrusco (notifications not working) Note Edited: 0035961
2010-03-23 06:03 Flávio Etrusco (notifications not working) Note Edited: 0035961
2010-03-23 08:44 Alexander S. Klenin Note Added: 0035965
2010-03-23 13:11 Flávio Etrusco (notifications not working) Note Added: 0035972
2010-03-23 15:14 Alexander S. Klenin Note Added: 0035978
2010-03-24 16:46 Flávio Etrusco (notifications not working) Note Added: 0036035
2010-03-26 17:20 Alexander S. Klenin Note Added: 0036117
2010-03-26 17:20 Alexander S. Klenin Note Edited: 0036117
2013-09-03 12:07 Martin Friebe LazTarget post 1.2 => 1.4
2014-06-11 20:26 Juha Manninen Relationship added has duplicate 0026328
2015-04-27 21:59 Juha Manninen LazTarget 1.4 => -
2016-01-24 14:45 Juha Manninen Relationship added has duplicate 0029498
2016-01-24 18:16 Ondrej Pokorny Note Added: 0089319
2016-01-26 12:16 Balázs Székely Note Added: 0089397
2016-01-26 12:16 Balázs Székely File Added: JumpToMehodBody.patch
2016-01-26 14:27 Ondrej Pokorny Assigned To => Ondrej Pokorny
2016-01-26 14:27 Ondrej Pokorny Status acknowledged => assigned
2016-01-26 14:38 Ondrej Pokorny Note Added: 0089404
2016-01-26 14:54 Balázs Székely Note Added: 0089405
2016-01-26 14:56 Ondrej Pokorny Note Added: 0089406
2016-01-26 17:56 Ondrej Pokorny Fixed in Revision => 51422
2016-01-26 17:56 Ondrej Pokorny Note Added: 0089411
2016-01-26 17:56 Ondrej Pokorny Status assigned => resolved
2016-01-26 17:56 Ondrej Pokorny Fixed in Version => 1.7 (SVN)
2016-01-26 17:56 Ondrej Pokorny Resolution open => fixed
2016-01-26 19:46 Balázs Székely Note Added: 0089414
2016-01-26 20:43 Ondrej Pokorny Note Added: 0089416
2016-01-27 12:55 Juha Manninen Relationship added has duplicate 0029518
2016-02-26 10:25 Ondrej Pokorny Relationship added related to 0029730