Tab stops
jweather
Posts: 320
So I just ran into the tab stop problem, working on code together with another programmer who uses a different value for the tab stops (1 vs. my 8). I'm still not sure how it managed to do this, but Studio saved the resulting file with 8-space tabs for my existing code, and 1-space tabs for the new code, meaning the edited file had a mix of tab values and was unrecoverable except by editing by hand. That doesn't seem like it should even be possible, but anyway...
Emacs has a feature that lets you set the tab stops for a file in a specially-formatted comment at the top of the file, like:
/* -*- tab-width: 4 -*- */
Can we get a similar feature in Studio so it automatically sets your tab width to the value specified in the file when you open it?
Emacs has a feature that lets you set the tab stops for a file in a specially-formatted comment at the top of the file, like:
/* -*- tab-width: 4 -*- */
Can we get a similar feature in Studio so it automatically sets your tab width to the value specified in the file when you open it?
0
Comments
When I saved the original file, every run of 8 spaces was converted to a tab. So far so good.
When he opened the file, it displayed the existing tabs as single spaces -- not the end of the world, although it made the indentation a little odd.
He added some lines, spacing the same as mine.
When he saved the file, though, it left the existing lines with the same number of tabs, but added a tab for every run of 1 spaces in his new lines. So when I opened it again, my lines still looked normal, but his were indented off the right side of the page.
If it had converted everything, it would have been recoverable. If it had used the existing size, it would have been recoverable. Since it mixed the two tab widths, it had to be edited back by hand to fix.
When NS takes out the indentaitons it can be real hard to read my code. That bad thing was NS2.6 still wouldn't save the ones I fixed. When I reopened the project, they were right back to being bad.
I've been pleased with NS3beta, however. It seems to do Tabs quite well.
Paul
I was under the assumption that thjis is what it was doing... (just adding X spaces when you hit the tab key.) That's kind of the thing you'd assume when you go into the settings page and tell it how many spaces to tab... alas and anon...
That is what NS2 SHOULD do, but it's not what it actually does. It actually puts in a tab, which isn't a collection of spaces. If it put in a bunch of spaces, we wouldn't have these problems.
J
PrettyPrint
http://en.wikipedia.org/wiki/Prettyprint
Code Beautifier / Formatter Overview
http://www.smashingmagazine.com/2007/07/12/time-savers-code-beautifier-and-formatter/
I remember coming across a program where you could put in your own Syntax and all that and create a language, but forget the name of it.
--John