Forum > IDE/CodeTools
"Find declaration" option is used to do two different things
furious programming:
Now we have a hell of a problem, because the change was introduced in the IDE, and we will have to wait many months for the next stable version of Lazarus. Navigation in the code editor has been broken and we will have to deal with this for a long time...
Currently, the only solution that allows consistent operation and to choose the jump target (declaration or implementation) is to use this new option and IDE macros. You should check the Jump directly to method body option so that Alt+Up always takes you to the implementation, and then record an IDE macro containing two items — Find declaration (i.e. jump to the implementation) and then Find Procedure Definition (jump from body to declaration). Then set the Alt+Down shortcut for this macro.
The macro should have the following content (see attachment):
--- Code: Pascal [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---beginecFindDeclaration;ecFindProcedureDefinition;end.
From now on, pressing the Alt+Down shortcut will execute a macro, first simulating pressing Alt+Up and then Shift+Ctrl+Up. If you jump to a routine declaration, the macro will do it for you, but if you use it on the identifier of a constant, variable, data type, etc. (something that does not have implementation), the macro will also jump correctly to the declaration of that identifier (the second macro shortcut will do nothing).
The only problem is that you have to get used to the fact that Alt+Up jumps to the routine definition and the fact that using the macro adds two items to the Jump history, so to return to the previous place after jumping, you need to go back twice (press Alt+Left twice).
TRon:
--- Quote from: furious programming on January 23, 2024, 01:48:41 pm ---Now we have a hell of a problem, because the change was introduced in the IDE, and we will have to wait many months for the next stable version of Lazarus. Navigation in the code editor has been broken and we will have to deal with this for a long time...
--- End quote ---
That is why fixes exit. Now that there was an overhaul in version numbering that also allows for many more bug-fix iterations (which I assume was one of the reasons for the leap in version numbering).
furious programming:
Subsequent versions of stable Lazarus are released too rarely. Bug-fixes should appear at least every month or two. I know it's a bit more work, but waiting a year for a new version with bug fixes and some new features is definitely too long. Especially for those who don't use the trunk version and don't want to use it (e.g. me).
dbannon:
--- Quote from: furious programming on January 23, 2024, 01:48:41 pm ---Now we have a hell of a problem, because the change was introduced in the IDE, and we will have to wait many months for the next stable version of Lazarus. Navigation in the code editor has been broken and we will have to deal with this for a long time...
....
--- End quote ---
Er, wait a minute, the "Jump directly to Method Body" as an option is not new, been there for some time. And its optional, just don't select it.
The real problem IMHO is that you have to choose, you can have quick access to the definition or the implementation, NOT both. Thats all that needs be fixed. I agree that the "Jump..." option in Code Tools was a silly way of dealing with the problem, drop it, make a new "Find implementation" and, by default map it to Alt-Down. As furious suggested in his first post. The code to do so must already exist, its 'just' a UI change.
Davo
MarkMLl:
--- Quote from: Thaddy on January 22, 2024, 07:14:55 pm ---ctrl-shift-downarrow, ctrl-shift-uparrow. Is that not enough?
--- End quote ---
No, it's not. We're both old enough to remember when word processors required amusing key combinations, and both old enough to find the amusement turning to discomfort. And we're both old enough to remember when people complained that the uniform UI introduced by MS Windows (albeit largely based on IBM CUA) would stifle innovation.
And I've seen commercial keyboards that would make your blood run cold.
I'm sorry, but I'm dead against having to remember key combinations. One of the strong points of the Windows-style UI was that you could navigate through a menu sequence which would give you a reasonable idea of what you were about to do /before/ /you/ /did/ /it/, and might also hint at a key combination if you wanted to do it again in the short term.
Having to remember key combinations (i.e. as you suggest is optimal for the Lazarus IDE), or having to remember outre gestures (as required by Android etc.), has no place in decent user interface design.
MarkMLl
Navigation
[0] Message Index
[#] Next page
[*] Previous page