Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: UberNewb on July 01, 2013, 04:10:34 am

Title: Smart indent indents twice after opening curly brace of if statement
Post by: UberNewb on July 01, 2013, 04:10:34 am
Since upgrading from CB 12.11 from 8.05 I have noticed that smart indent does not work the same as it used to.

(assuming indent level of 3 spaces)
Previous behaviour (pressing enter after the opening curly brace of an if statement leaves the pipe one indentation level greater than before) :
Code
if (1) {
   |

Current behaviour (pressing enter after the opening curly brace indents two levels) :
Code
if (1) {
      |

Is this a bug, or a setting I need to fix?
Title: Re: Smart indent indents twice after opening curly brace of if statement
Post by: oBFusCATed on July 01, 2013, 08:51:56 am
Bug.
Title: Re: Smart indent indents twice after opening curly brace of if statement
Post by: UberNewb on July 01, 2013, 06:15:20 pm
I can confirm the behaviour is still there in the latest nightly, 9158 from June 16, 2013
Title: Re: Smart indent indents twice after opening curly brace of if statement
Post by: Jenna on July 01, 2013, 09:39:27 pm
Can you cplease test whether it works correctly, if you delete the indendation with backspaces until the cursor is directly after the brace and press enter ?
In this case the double-indendation does not happen here.
This should not be a workaround, but a hint for (an)other dev(s) to find the issue.
Title: Re: Smart indent indents twice after opening curly brace of if statement
Post by: UberNewb on July 02, 2013, 07:36:29 am
Yes, oddly enough backspacing back to the curly brace and pressing enter again only indents one level...