On Dec 22, 7:41 pm, pansz <[email protected]> wrote:
> Brett Stahlman 写道:
>
> > If you use tabs only for leading indent, an indent level can
> > be whatever you want it to be when you're viewing the file. Almost as
> > importantly, it can be whatever someone else wants it to be when he's
> > viewing the same file...
>
> No, this is a false illusion, you cannot expect a non-constant indent
> level anyway, consider the following code.
>
> suppose we have 4 space as indent level:
> {
> foobar1(); // comment1
> if (fb2()) { // comment2
> fb3(); // comment3
> switch (x) { // comment4
> case 1:
> fb4(); // comment5
> break;
> default: // comment6
> break;
>
> }
> }
> }
>
> now we change the indent level to 3:
>
> {
> foobar1(); // comment1
> if (fb2()) { // comment2
> fb3(); // comment3
> switch (x) { // comment4
> case 1:
> fb4(); // comment5
> break;
> default: // comment6
> break;
>
> }
> }
> }
>
> Got the idea? If anyone wants to change the indent level, the code is
> ruined anyway.
No. I didn't say use only tabs. I said "use tabs only ***for leading
indent***". The distinction is very important. To align end of line
comments within a block, you use spaces. Not only does using space for
leading indent waste an excessive amount of space in source files with
relatively short lines and high levels of indent, it also forces
everyone viewing the file to use the indent level preferred by the
original author.
Brett Stahlman
>
> Simply use only space for indent solves all problem above, personally I
> do recommend not to use tab size other than 8 at all.
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---