GNOME Bugzilla – Bug 612761
Editor reverts to 4-space tabs regardless of tab settings
Last modified: 2010-03-13 17:05:26 UTC
Overview: As the summary indicates, the default Anjuta editor (gtksourceview I assume?) seems to be insisting on 4-space tabs, and I can't get any other tab size to stick. This is a pretty trivial bug, which means it's exactly the kind that leads to the most nerd rage and irrational screaming. Version, Platform, and Settings: I'm using version 2.28.0 from the Ubuntu 9.10 repositories on the x86-64 architecture. My own relevant settings in the Anjuta preferences include: C/C++/Java/Vala category, Smart Indentation tab: - Indentation Parameters, "Statement indentation size in spaces: 8" - Parenthese indentation, "* Indent: 8" GtkSourceView Editor category, Editor tab: - Indentation and auto-format options, "Tab size in spaces: 8" - Indentation and auto-format options, "[check] Use tabs for indentation" There might be other settings influencing this behavior, but those are the obvious ones. Steps to Reproduce: 1.) Start a new C++ project. 2.) Open the main.cc file. The editor will show 4-space tabs. 3.) Try changing the "Tab size in spaces" setting arbitrarily, and you can see the tab size changing, as it should. 4.) Do any amount of editing, then save the file. As soon as you save, the tab size will revert to 4 spaces. (Certain editing actions seem to do this too, but saving after editing seems to be the easiest way to reproduce the bug.)
I just noticed that the first line of main.cc includes: /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */ Changing the tab-width setting and saving the file allows for tabs of any size. It seems that the per-file settings simply override the Anjuta Preferences. I assume this is by design. Since my tabs were already set to 8 spaces at the time I created the project (the setting seems to persist across projects in the Preferences dialog), it would probably be more appropriate to reframe this issue: Anjuta insists on writing a hardcoded tab-width value into the main.cc file regardless of user settings in Preferences, and it's overriding those user settings.
Yes, anjuta prefers modelines over the preference setting because otherwise you could easily screw up files. Thanks for the bug report. This particular bug has already been reported into our bug tracking system, but please feel free to report any further bugs you find. *** This bug has been marked as a duplicate of bug 563986 ***
Thanks for reporting this bug. It has already been reported more than one year ago but I have done nothing to fix it. It's not really difficult to fix but it needs some small global changes. I think it's too late for the next release. But you are the third user reporting it, we really need to do something about it. I will try to take care of it, beginning of April, just after the release. If you see no change here do not hesitate to send me a reminder.
Thank you, and sorry about the duplicate!
Please don't revert a duplicated bugs to unconfirmed unless you disagree that it is a duplicate. Thanks! But it's not a problem when you report duplicates. Nobody expects you to check the whole bug-tracking system and it is in general difficult to find a correct keyword for the search. *** This bug has been marked as a duplicate of bug 563986 ***