[OT] Spaces/tabs (Was: simple display (from: GUI library for D))
Bruno Medeiros
brunodomedeiros+spam at com.gmail
Wed Apr 13 06:16:44 PDT 2011
On 12/04/2011 21:08, Nick Sabalausky wrote:
> ""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).
>>
>
Why would editors not allow you to enter that right? I don't see what
the problem would be, unless you configured your editor to replaces N
spaces into a tab for indentation.
> 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.
>
Works fine in Eclipse, again because when it auto-indents on Enter, it
uses the indentation of the previous line. :)
--
Bruno Medeiros - Software Engineer
More information about the Digitalmars-d
mailing list