[SOLVED] How to "Jump To" the "begin" of a method, not the declaration lazarus / 11-Options ---------------------------------------------------------------------- RedOctober · 2024-09-13 14:37 I've just upgraded from Lazarus 2.0.10 to 3.4.  In my old version, I can hold down the Ctrl key then click on a procedure or function call, and my cursor will jump me to the "begin" in the procedure or function who's name I clicked on.  In 3.4, when I do this, I get jumped to the declaration at the top of the unit, then I have to Ctrl+down arrow to get to the "begin".  In both versions, I have the exact same setting in Tools/ Options, Environment, Editor, Mouse, Ctrl Button = Jumps to implementation. Is this a bug in 3.4, or is there something else I need to do to get the behavior I had in 2.0.10? TIA. ---------------------------------------------------------------------- Martin_fr · 2024-09-13 14:53 Don't know, seems to work fine for me with 3.4. Though, I don't use this normally. I just did a once off test. That may miss something. Ignoring if the settings are the same.... Do you have the option "jump directly to method body" enabled? Have you tested with  - ctrl left mouse click - Alt cursor up ? ---------------------------------------------------------------------- WooBean · 2024-09-13 16:12 In Lazarus 3.99 (rev main_3_99-2623-g10f44cfcff) FPC 3.2.2 x86_64-win64-win32/win64 when Tools/Options/[IDE Options]/Codetools/General/Jump directly to method body checkbox is checked - jumping works as TS expected. ---------------------------------------------------------------------- RedOctober · 2024-09-13 19:52 Hi All, thanks for the help.  Jump works now.  I did not realize that there was another setting involved that I didn't set. "Tools/Options/[IDE Options]/Codetools/General/Jump directly to method body checkbox is checked" (As described by both respondents) ---------------------------------------------------------------------- Markus · 2025-04-23 07:24 This worked for me in version 2.x, but not after I updated to version 3.8. I have checked Tools > Options > Codetools > General > "Jump directly to method body". When I place my mouse cursor over a procedure call, it shows the position in the source code below as a link. When I then click on that link, it jumps to the declaration, not to the body of that procedure. Do I miss something here? ---------------------------------------------------------------------- dbannon · 2025-04-24 12:05 Certainly works on 3.6 and 3.8, main for me. Quote from: Markus on April 23, 2025, 09:24:57 amI have checked Tools > Options > Codetools > General > "Jump directly to method body". Are you sure, could you please have another look to make sure its checked ? [/quote] Might be worthwhile mentioning your Operating System details.... Davo ---------------------------------------------------------------------- Markus · 2025-05-13 11:58 Sorry for not seeing your reply immediately. Please look at the attached screenshots. The operating system is Windows 10, 64-bit. ---------------------------------------------------------------------- dbannon · 2025-05-15 12:12 OK Marcus, here is a suggestion.  My superficial testing indicates to me that it does work for an LCL application, ie one making a GUI app but DOES NOT work for a pure FPC application. So wider testing is clearly necessary to track this down conclusivly. Tests with both Lazarus 3.8 and 4.0 A spare time activity ! Please folks, help here, select Tools->Options->Code_Tools and make sure "Jump directly to method body" is ticked. Hold down the control key and hover your mouse over a method call, click the underlined method name and tell us where you jump to, the declaration or implementation ?  And tell us if yours is a GUI or command line app. Maybe there is something else different between the apps I tested, what ever it is, there is definitely something wrong here. Davo ---------------------------------------------------------------------- paweld · 2025-05-15 12:40 Jump to the procedure body does not work if the definition and body of the procedure are in the same section - in non-GUI applications there is no section, and for LCL applications it is enough that the definition and body are in the implementation section. I checked in Lazarus 4.99-trunk ---------------------------------------------------------------------- dbannon · 2025-05-18 00:03 Yep paweld, thats a good explanation about why we see what we see. Probably answers Markus's question. But I consider this a bug, I expect Jump to Body to do just that !  I'll log it if anyone else agrees. Davo ---------------------------------------------------------------------- cdbc · 2025-05-18 08:13 Hi @Davo: Linux -> fpc 3.3.1 -> laz 4.99 -> console-app: Jumps right to implementation. Regards Benny ---------------------------------------------------------------------- dbannon · 2025-05-19 10:55 Quote from: cdbc on May 18, 2025, 10:13:16 amHi @Davo: Linux -> fpc 3.3.1 -> laz 4.99 -> console-app: Jumps right to implementation. Regards Benny Wow, thats interesting Benny. My tests here based on a month (or so) old Lazarus main and FPC "3.2.4" (ie the beta, fixes or what ever) compiler. I very much doubt its a FPC issue so, does that indicate its been very recently fixed ?  I'm traveling and network is pretty flacky,  Maybe I'll try tomorrow, been a long day today ! Davo ---------------------------------------------------------------------- dbannon · 2025-05-21 04:52 No Benny, testing using Lazarus Main shows same problem. Did you try code like this, press Ctrl, move mouse cursor to line  #27 "MyClass.SomeProc();"  (on SomeProc) and click it when it becomes blue. In my case, it jumps to the declaration (line #14) !   t should jump to line #20 Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i program project1;{$mode objfpc}{$H+} uses    {$IFDEF UNIX}    cthreads,    {$ENDIF}    Classes    { you can add units after this }; type TMyClass = class    public        procedure SomeProc;end; var  MyClass : TMyClass; procedure TMyClass.SomeProc;begin    writeln('hello');end; begin  MyClass := TMyClass.create();  MyClass.SomeProc();  MyClass.free;end.  I don't feel like building a main FPC on my laptop while away, and really don't see this as a FPC issue. Davo ---------------------------------------------------------------------- cdbc · 2025-05-21 05:41 Hi Davo I think it's 'CodeTools' acting up or getting confused and as such it lies below my "Bagatel-Threshold"  Regards Benny