www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 11227] New: Visual D 'smart' indent mode is too inflexible with parentheses.

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=11227

           Summary: Visual D 'smart' indent mode is too inflexible with
                    parentheses.
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: VisualD
        AssignedTo: nobody puremagic.com
        ReportedBy: entheh cantab.net



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.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Oct 11 2013
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=11227


Rainer Schuetze <r.sagitario gmx.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |r.sagitario gmx.de



PDT ---
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.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Oct 12 2013
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=11227




PDT ---
I have updated the indentation as described and made a release candidate
available here: https://github.com/D-Programming-Language/visuald/releases

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Oct 18 2013