Author Topic: RC3/4: C/C++ brace indent doesn't match formatting settings  (Read 2005 times)

jnairb

  • Senior Community Member
  • Posts: 204
  • Hero Points: 11
RC3/4: C/C++ brace indent doesn't match formatting settings
« on: September 04, 2014, 10:39:53 pm »
Running on Windows 7 x64 with my 19.0.0 config updated from 18.0.1 config (not beta1). My brace style is Next Line Indented, and Auto-Complete syntax expansion is set to NOT automatically insert braces.

If I enter an 'if' statement (for example), type in the if-condition, then press Ctrl-Enter (nosplit-insert-line), the cursor is properly placed on the next line and indented from the if. Then I type an open brace '{', and the open and close brace are inserted in the same column as the if statement, not indented. The same happens for a few other statements that I've tried.

I don't use adaptive formatting, and this happens even in an empty file (with just a main() function and its open/close brace).
(Note: changed subject to reflect this problem is back in RC3/4)
« Last Edit: November 06, 2014, 03:41:46 pm by jnairb »

patrick

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 986
  • Hero Points: 78
Re: B2: C/C++ brace indent doesn't match formatting settings
« Reply #1 on: September 05, 2014, 01:41:47 pm »
Interesting, trying to reproduce it.

If you go to the Document -> C/C++ Options page, which of the "Beautify *" options are checked if any?  In your beautifier profile, under Indent -> Indent Rule Exceptions, is "Indent first level of code" on or off?

jnairb

  • Senior Community Member
  • Posts: 204
  • Hero Points: 11
Re: B2: C/C++ brace indent doesn't match formatting settings
« Reply #2 on: September 05, 2014, 01:55:05 pm »
The only Beautify option that I have selected is Beautify syntax expansions.

patrick

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 986
  • Hero Points: 78
Re: B2: C/C++ brace indent doesn't match formatting settings
« Reply #3 on: September 05, 2014, 02:00:10 pm »
What about the "Indent first level of code" setting?  I asked that because it does figure into the calculations done when figuring out where the braces should go, and from what I've seen typing in some examples here, it may be involved in the a problem specific to this brace style.

jnairb

  • Senior Community Member
  • Posts: 204
  • Hero Points: 11
Re: B2: C/C++ brace indent doesn't match formatting settings
« Reply #4 on: September 05, 2014, 02:04:47 pm »
Sorry. Indent first level of code is ON.

patrick

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 986
  • Hero Points: 78
Re: B2: C/C++ brace indent doesn't match formatting settings
« Reply #5 on: September 05, 2014, 09:41:27 pm »
This is fixed for the next beta drop. 

jnairb

  • Senior Community Member
  • Posts: 204
  • Hero Points: 11
Re: B2: C/C++ brace indent doesn't match formatting settings
« Reply #6 on: November 05, 2014, 11:44:02 pm »
This problem is back in RC3 -- if, switch, while, for, etc... same thing happens as was happening in beta 2.

patrick

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 986
  • Hero Points: 78
Re: B2: C/C++ brace indent doesn't match formatting settings
« Reply #7 on: November 06, 2014, 03:46:27 pm »
Argh, sorry.  Different problem interrupting the same sync code that had a problem before.  Fixed for either the next build, or it will go into the first hotfix. 

As a workaround, going to Tools -> Beautify -> Edit Profile and then hitting Ok on the resulting profile editor dialog should 'fix' any buffers you happen to have open at the time.