GNOME Bugzilla – Bug 742934
Builder sometimes does not honor indentation preferences
Last modified: 2015-01-20 14:50:11 UTC
Created attachment 294551 [details] screencast demonstrating broken indentation setting I have my indentation settings for a CMake file set to four spaces, no tabs. But when I press the tab key, Builder indents eight spaces (no tabs).
I think this is because we are only setting tab_width, and not indent width. We don't currently expose them as individual options either. We can either: 1) g_settings_bind() both to tab_width from gsettings 2) expose them as individual options I think we may have to go with 2, because some projects like nautilus use 2 space indents with hard tabs at 8.
Does comment #1 explain why it's impossible to convince builder to add any hard tabs to e.g. epiphany/src/ephy-prefs.c? That file consistently uses eight-space tabs for indentation. Builder autodetects two spaces, no tabs. When I change the setting to eight space tabs, Builder still inserts two spaces when I press the tab key.
(In reply to comment #1) > I think this is because we are only setting tab_width, and not indent width. We > don't currently expose them as individual options either. > > We can either: > > 1) g_settings_bind() both to tab_width from gsettings > 2) expose them as individual options > > I think we may have to go with 2, because some projects like nautilus use 2 > space indents with hard tabs at 8. I'd like to have vim/emacs/etc. tabs-settings parser.
A good place to start: https://git.gnome.org/browse/gedit/tree/plugins/modelines/modeline-parser.c
(In reply to comment #4) > A good place to start: > https://git.gnome.org/browse/gedit/tree/plugins/modelines/modeline-parser.c great! I think more better to do this on gnome-code-assistance layer, but not sure.
It needs to be done where the auto indenters live, which is inside the editor process (ie: Builder itself).
Created attachment 294944 [details] [review] sourceview: make indent-width match tab-width We still need to expose this in language settings.
The bug in question here should be fixed in master. I'd still like to expose indent-width separate from tab-width at some point. Attachment 294944 [details] pushed as 9bd5a04 - sourceview: make indent-width match tab-width
(In reply to comment #1) > I think we may have to go with 2, because some projects like nautilus use 2 > space indents with hard tabs at 8. In these projects, pressing the tab key needs to always insert a tab character. I'm not sure what the value would be in having a separate setting for indentation size?