Hallo, Miller Puckette hat gesagt: // Miller Puckette wrote:
Just to throw in my own 2 cents... The Pd sources are: tabs 8 spaces (their historical value), indentation 4 spaces. This unfortunately means that Pd does mix spaces and tabs for indentation. However, there's no rule that says that Pd source files have to use tabs at all; the indentation may be implemented using all spaces. However, I haven't set my own text editor to avoid tabs. Most text editors will at least allow you to set tab to 8 spaces, although some of them then assume that of course you want to indent 8 spaces too, which is inappropriate for Pd code, since I also adhere to a limit of 80 columns.
I also feel, that indenting 8 visible spaces is too wide. I normally use tabs everywhere, but let them appear in my editor (Vim) 4 spaces wide. It's enlightening to read, what the Vim docs say about this: (tabstop is width of tab, shiftwidth is indent width)
There are four main ways to use tabs in Vim: 1. Always keep 'tabstop' at 8, set 'softtabstop' and 'shiftwidth' to 4 (or 3 or whatever you prefer) and use 'noexpandtab'. Then Vim will use a mix of tabs and spaces, but typing Tab and BS will behave like a tab appears every 4 (or 3) characters. 2. Set 'tabstop' and 'shiftwidth' to whatever you prefer and use 'expandtab'. This way you will always insert spaces. The formatting will never be messed up when 'tabstop' is changed. 3. Set 'tabstop' and 'shiftwidth' to whatever you prefer and use a |modeline| to set these values when editing the file again. Only works when using Vim to edit the file. 4. Always set 'tabstop' and 'shiftwidth' to the same value, and 'noexpandtab'. This should then work (for initial indents only) for any tabstop setting that people use. It might be nice to have tabs after the first non-blank inserted as spaces if you do this though. Otherwise aligned comments will be wrong when 'tabstop' is changed.
You use 1, I use 4., 2. will work everywhere, 3. only in Vim. Duh!
ciao