View.setIndentWidth
void setIndentWidth(int width)Sets the number of spaces to use for each step of indent when the tab key is pressed.
If width is -1, the value of the gtksource.view.View.tabWidth property will be used.
The gtksource.view.View.indentWidth interacts with the gtksource.view.View.insertSpacesInsteadOfTabs property and gtksource.view.View.tabWidth. An example will be clearer:
If the gtksource.view.View.indentWidth is 4 and gtksource.view.View.tabWidth is 8 and gtksource.view.View.insertSpacesInsteadOfTabs is false, then pressing the tab key at the beginning of a line will insert 4 spaces. So far so good. Pressing the tab key a second time will remove the 4 spaces and insert a \t character instead (since gtksource.view.View.tabWidth is 8). On the other hand, if gtksource.view.View.insertSpacesInsteadOfTabs is true, the second tab key pressed will insert 4 more spaces for a total of 8 spaces in the gtk.text_buffer.TextBuffer.
The test-widget program (available in the GtkSourceView repository) may be useful to better understand the indentation settings (enable the space drawing!).
Parameters
width | indent width in characters. |