Author Topic: auto formatting braces  (Read 156 times)


  • Senior Community Member
  • Posts: 118
  • Hero Points: 1
auto formatting braces
« on: March 13, 2019, 07:04:34 pm »
I have multiple C++ projects. In one project the automatic formatting of braces works as configured, both braces on their own lines and the code between them is indented. With the other projects the open brace is always put on the same line as statement. Even when I put the cursor on the next [blank] line and hit the open brace key, it's put on line before and the end of the statement.
In Options->Languages->All Languages->Formatting the Begin/end style is set to "next line". In Options-Languages->Application Languages->C/C++->Formatting the code preview shows all the example code formatted correctly with each brace on its own line and code indented from the brace. Yet, for many projects it has no effect.
This use to work until I updated to v23.0.0.1. I just updated to v23.0.1 and installed the hotfix, and it still doesn't work.
It also insists on uses tabs rather than spaces, even though I unselect the "Indent with tabs" checkbox. And when I check the option again, it's back to being selected. It doesn't seem to want me to change it.


  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1025
  • Hero Points: 86
Re: auto formatting braces
« Reply #1 on: March 13, 2019, 08:49:21 pm »
I wouldn't expect the tabs/spaces or other setting to change unless Adaptive Formatting is enabled.  And in that case we'd need look at the output of adaptive-formatting-stats to determine why it made those decisions for particular files. 

I know of one thing that changed with adaptive formatting with 23.0.1, and that was a fix for a problem where adaptive formatting settings could leak across multiple files, rather than being per file.  I'm wondering if that leak could have helped you out before, where large files that had plenty of samples for AF to be confident in the inferred settings got you the project settings you wanted, and whenever you visited a file that AF was not confident in (or wrong), it didn't matter because the leaked settings kept it consistent with other files.