Suggested changes to Delphi editor


I'm fed up with some silly behaviour in the Delphi editor which makes it unfriendly for mouse-heavy users. Primarily these are differences from what has become de facto standard Windows behaviour, as implemented in TMemo and TRichEdit and indeed in Word and virtually all other text-based applications including most text editors, code editors, HTML editors, etc, as well as the editor in Visual Studio.

I'm intending to put these into Quality Central as change requests, where they will obviously receive the appropriate amount of consideration.

Meanwhile, I'd like to post them here for comments, such that what goes into QC will have been polished (or eliminated!) by you guys 'n' gals.

1/ No "extend selection by word"

In most editors:

a/ you click and drag to select a string of characters.
b/ you double click to select a word
c/ you double click and drag to select a string of words

Option c/ is not implemented in the Delphi editor. For instance, suppose I have this in my code:


....and I want to select 'editHz.Focused'. The natural thing to do is double click 'editHz' (which selects it) and then drag to the right to add '.Focused' to the selection. Try this is any editor you can find OTHER than Delphi and it works. In Delphi dragging does nothing. So instead you have to carefully place the cursor between the first '.' and the 'e', and then drag across to the right of the final 'd'. Significantly slower, and it requires unlearning a natural behaviour which works in every other application. Try it, and you'll see what I mean.

I propose implementing c/, such that after double-clicking, dragging extends the selection word-by-word, just like in TRichEdit.

2/ Cursor not constrained by line ends

In most editors, to add text to the end of an existing line, you just click anywhere beyond the last character and start typing. In Delphi, do that and it immediately pads the lines with spaces up to the point where you placed the cursor. This is completely non-standard behaviour. It requires you to position the pointer exactly - just to the right of the final character on the line, which takes extra time.

I appreciate that this behaviour may be desired by some users, so:

I propose an option in the editor very similar to the one called 'Cursor beyond EOF'. Just call it 'Cursor beyond EOL' and enable it by default. That way fusspots like me can disable it. Note that it should also constrain the cursor when using the up and down arrow keys to navigate, just like every other application (and TRichEdit) does.

3/ Clicking at the start or end of a selection does not de-select

In any editor other than Delphi, click immediately to the left or right of some selected text and start typing. The text becomes de-selected and you start adding new text to the beginning or end of it. In Delphi, the selection is NOT de-selected, and when you start typing you immediately delete the selected text, replacing it with the new. To achieve what you want, you have to click one or more characters *beyond* the selection, and then click again (or arrow key) back to where you want to type.

It is fairly uncommon to do this when coding, but I do it often enough to notice it and find it a nuisance.

I propose altering the behaviour such that clicking immediately to the left or right of selected text de-selects it, just like every other application (and TRichEdit).

I realise that there are keyboard shortcuts to achieve all the above, but I'm naturally a mouse-heavy user (as, I suspect, are many younger people who weren't coding back in the days of green screens!). Normally I can work like fury with a mouse, but these odd behaviours in Delphi slow me down and irritate me.

Any comments, anyone? Any others you think I should add?