[OT] Spaces/tabs (Was: simple display (from: GUI library for D))
Nick Sabalausky
a at a.a
Tue Apr 12 13:08:45 PDT 2011
""Jérôme M. Berger"" <jeberger at free.fr> wrote in message
news:io2396$1nuo$1 at digitalmars.com...
>spir wrote:
>>
>> A drawback is one cannot directly have different indent levels, for
>> instance to indent collection contents more, or less, than blocks of
>> code. This can also be considered an advantage; and is simply solved by
>> using... spaces ;-)
>>
>> void f () {
>> -> while (true) {
>> -> -> table = [
>> -> -> .."aaa" : 1,
>> -> -> .."bbb" : 2,
>> -> -> .."ccc" : 3,
>> -> -> ];
>> -> -> auto a = this(table);
>> -> -> if (! a) break;
>> -> }
>> }
>>
>> (yes, the example is stupid)
>>
>Unfortunately, most editors are completely unable to handle this
>example properly: sure they will *display* it fine, but they will
>not allow you to *enter* it right (especially if you need more
>spaces for alignment than the tab size).
>
That's unfortunately true. I used to try to do that in cases like this:
if(blah)
{
-> foo(.bigLongArg1,
-> .....bigLongArg2,
-> .....bigLongArg3
-> );
}
But editors just choke on that like crazy. It's a pain to type it in that
way, and then when you go back to edit (add another arg on another line, for
instance), it just screws it all up again, likely without me even noticing
right away. (And I even have most auto-formatting turned off.) I decided it
was far more trouble than it was worth.
So I've changed my style to this:
if(blah)
{
-> foo(
-> -> bigLongArg1,
-> -> bigLongArg2,
-> -> bigLongArg3
-> );
}
Much better. Of course, it would be even better still if Scintilla would be
willing to add elastic tabstops (I'm getting increasingly annoyed that it
doesn't, and that it doesn't even seem receptive to the idea, for technical
reasons), because then I *could* do exactly what I used to with absolutely
no problem:
if(blah)
{
-> foo(->bigLongArg1,
-> -> bigLongArg2,
-> -> bigLongArg3
-> );
}
And everything would always align properly.
More information about the Digitalmars-d
mailing list