Open gregwillits opened 2 years ago
This looks like something that the CDT editor needs to do. AFAICT the JDT (Java) editor does what you want. The CDT editor was originally created as a clone of the JDT editor, and it looks like this is an improvement that needs to be ported across.
Schweet :-) Thanks.
It would be very useful (productive) to have white space be double-clickable as a word.
This is a common capability in Mac software, so in all my other editors and even word processor do this, and I find myself auto-piloting in Eclipse, but having to do more difficult keyboarding which takes longer. (All small differences of course, but still noticable in the work flow.)
Let me explain...
If we look at the code fragment below, the text is aligned in pseudo columns. Let's say that the word Length needs to change to Size, so that delimiterLength becomes delimiterSize, and csvStringLength becomes csvStringSize. Let's also say we change
elements
tomembers
, andmaxLimit
tostringLimit
.After refactoring, we get this. Now it's time to realign the comments. Many ways to do that.
What I find the fastest (not necessarily the fewest key strokes) in my other editors is that I double click in the white space gap, and press tab as needed to realign. So, double click in the gap of
stringLimit; // Max
will select the entire white space between ";" and "/" just like double-clicking a word. It's a very quick right hand on the mouse double-clicking the affected gaps, and left hand whacking Tab.I use this without even thinking about it in so many places. I suspect there's better examples, but this is what popped into my head. Oh — even when mouse navigating around reading things, I might spot a place with extra spaces, I just double-click, hit Space or Tab, and done — vs. having to drag, or use shift-command-arrow key combinations to make a wide selection.
It surprises me that it's not a universal mouse behavior like word selecting. In Microsoft-land, Word doesn't do it, but Visual Studio Code does. Notepad tries to but it differentiates tabs vs spaces (defeats the purpose). Adobe doesn't do it in InDesign copy text, but in any of the user interface fields like creating a new Stye name, it does (probably leaning on standard Apple behavior there).
I don't know if it is something that can be added to CDT alone, or if you have to lobby for support all the way up the food chain. It is a small but productive selection behavior that I would find very useful in the Eclipse editor.
Thanks for all your work.
-- greg