Never hold down the SHIFT key again
I know you’re a good programmer, and you NEVER copy-and-paste code.
Right? RIGHT?
But sometimes, for whatever reason, you do need to select a chunk of code in the code editor.
How do you do this? Are you a drag-the-mouse-around-and-hope-to-get-it-right kind of programmer? Or are you a hold-down-the-shift-key-and-use-the-arrow-keys kind of programmer?
Whichever you are, forget it, because you’re about to learn a much better way:
Castalia has a feature called “Selection Expansion” that lets you select a chunk of code just by pressing a shortcut key (Ctrl+W by default).
When you press Ctrl+W, Castalia automatically selects the identifier under the cursor. Pressing Ctrl+W repeatedly will continue to expand the selection by logical groups, selecting the current expression, statement, block, etc… until you get the selection you wanted (or the whole method has been selected).
Consider this example (keep reading, there’s a movie at the bottom!):

Pressing Ctrl+W repeatedly selects:
- Left
- FirstInd.Left
- FirstInd.Left+FDragOfs-GutterWid
- The entire Trunc() call
- The entire Editor.Paragraph.FirstIndent assignment
- All of the code in the method
- The entire method
Selection Expansion is just one of the many ways Castalia saves Delphi programmers time and effort. Learn more (and try it out) at http://www.twodesk.com/castalia.
That looks extremely cool but isn’t there a step missing? Between C and D I would expect:
“(FirstInd.Left+FDragOfs-GutterWid) / RulerAdj”
Cheers,
Oliver