Author Topic: Smart Indentation problem with classes/functions on Linux (Ubuntu)  (Read 3285 times)

Garry

  • Guest
I'm using C::B 13.12 which I downloaded from the repository on Ubuntu 14.04, and I have installed the package codeblocks-contrib.  I have also enabled Auto Indent and Smart Indent (under Settings -> Editor -> General Settings).  I've enabled "Indent Classes ..." (under Settings -> Editor -> Source Formatter -> Indentation).

My problem is that when I type "int main() {" and then press enter, I get:

int main() {
|}

(where the vertical bar is the position of the caret).

The same problem was happening to me while using "for", "if" and "while" statements, but installing codeblocks-contrib fixed that, i.e. now when I type "if (true) {" and hit enter, I get:

if (true) {
  |
}

which is what I would expect for classes and functions as well.


In case it helps, I've attached a screenshot of my indentation settings.

Another strange thing is that if I turn off "Brace Completion", then the indenting works fine for classes/functions, but I get a double indent for "if", "while", "for".  So I have:

void func() {
  if (true) {
      |

(I have indentation size set to 2, BTW).



« Last Edit: May 17, 2014, 11:45:54 pm by Garry »