A Delphi 2006 code navigation feature you may not know about

BDS 2006 introduced a new code browsing feature in the code editor that I’m willing to bet most people are unaware of called Method Navigation which didn’t make it into my previous code completion video. It’s the ability quickly jump from one method to the previous/next in the implementation section of a unit. Here is how it works:

  • Place the cursor inside of a method/function/procedure in the implementation section of a unit (preferably something with lots of code)
  • Press Ctrl-Alt-Up Arrow or Ctrl-Alt-Down Arrow to navigate between function bodies

There is one more subtlety here, if you press Ctrl+Q+L you can toggle what’s called “Class Lock” meaning the above arrow keys will restrict their navigation to methods of the current class (if any). Anyway, just thought I’d mention another one of those little features that flies just below the radar.

5 thoughts on “A Delphi 2006 code navigation feature you may not know about

  1. Actually I think I found these shortcuts on Dan’s blog last year 😉
    But it can’t be blogged about often enough – it’s amazing to see when I do trainigs how many people don’t even know about CTRL-SHIFT-C, CTRL-SHIFT-ARROW and other simple things.
    However, I still prefer CTRL-G over CTRL-ALT-ARROW 😉
    Regards,
    Olaf

  2. Steve
    would you mind explaining how you went back from the Messages unit where you had arrived at TWMWindowposChanged to the original unit?
    (by holding down control and pressing mouse)
    You mention left and right arrows, but I do not understand why the arrows would not position the caret one left of right in the messages unit ??
    Feel very dumb, sorry
    Peter

  3. Hi Peter,
    Sorry for the slow reply. To browse backwards simply press Alt-LeftArrow likewise to browse forward press Alt-RightArrow. The only place where the mouse is involved in code browsing is when you hold the Alt key down and click an identifier.
    -Steve

Comments are closed.