Delphi: turn off column or line block selection mode – via: Default IDE Shortcut Keys; Delphi Programming
Posted by jpluimers on 2015/07/30
The Default IDE Shortcut Keys – Delphi Programming was a good starting point to find out how to disable column or line blocks.
Since the table there is incomplete (even the Embarcadero documentation is wrong as some shortcuts can turn on and off a mode), here are the relevant shortcuts keys:
Ctrl + O + C | Turns on/off |
Delphi 5 and up |
Ctrl + O + K | Turns on/off block selection mode | Delphi 5 and up |
Ctrl + O + L | Selects current line (and turns off block selection mode) | Delphi 5 and up |
This is especially useful when the block selection is stuck (this happens every now and then: it’s a known bug).
–jeroen
Brian Long said
I didn’t find Ctrl+O+C worked for turning it off, but have always used Ctrl+O+K
BTW, big collated list of shortcuts over at http://caryjensen.blogspot.co.uk/2013/02/delphi-editor-key-combination-table.html that includes these.
jpluimers said
Thanks for that.
woutervannifterick said
It “almost” works like other popular editors:
When you hold alt while you select, you’ll get block mode. Selecting some text without holding alt switches back to line mode.
That’s when you use the mouse only.
With the keyboard you can also block-select by holding alt+shift+cursorkeys, but it switches you to block mode permanently.
A “normal” keyboard-only selection (without alt) won’t switch the mode back to line selection, which I find quite annoying about the Delphi code editor.
If I were to implement this, I wouldn’t create “modes”. I’d just allow two ways to select, by either holding alt or not.
David M said
So if Ctrl+O+C turns off column selection mode, how do you turn it on? (Alt-drag? But how with the keyboard?)
jpluimers said
it’s a toggle, hence the on/off (;
vintagedave said
Ah. I was confused because Ctrl+O+K has “on/off” bolded, whereas this has only “off” bolded in the whole line – so I thought it only functioned as an off switch.