Bug 11227 – Visual D 'smart' indent mode is too inflexible with parentheses.
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
visuald
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-10-11T15:29:13Z
Last change time
2018-11-24T14:14:06Z
Assigned to
No Owner
Creator
entheh
Comments
Comment #0 by entheh — 2013-10-11T15:29:13Z
Visual D's 'smart' indent mode is great with {braces}, but not so good with (parentheses). If I write something like this:
Geschwindigkeitsbegrenzung geschwindigkeitsbegrenzung = new Geschwindigkeitsbegrenzung(
stuff,
moreStuff,
new MoreStuff(
evenMoreStuff,
...
),
);
then it goes wrong:
- If I press Enter after the '(', it takes me all the way out to just right of where the '(' is. Fair enough, it has to make some guess for the first line. It would be nice for it to be configurable but that's not the biggest issue. Read on;
- If I make sure the 'stuff,' line is indented as above (just one tab), then press Enter *after* the 'stuff,' line, then it STILL takes me all the way out to just under the '('.
When writing this kind of code, I would like Visual D to let me put the 'stuff,' line at any level of indentation I want, and for the next line to go to that same level by default.
Switching to 'block' indent mode solves the problem - but that's less convenient the rest of the time, because all indentation changes due to { and } need doing manually.
Comment #1 by r.sagitario — 2013-10-12T00:25:56Z
The indentation just moves one position right of the opening parenthesis. It would work for your example if it uses the position of the next token instead. That would also work better if your coding style is to have a space after the '('.
It doesn't solve the case if it's not the first argument that has less indentation, but it's a start.