Author Topic: Beautify-- need {} braces around all IF's, but don't know how.  (Read 197 times)

acmartin

  • New Community Member
  • Posts: 1
  • Hero Points: 0
I'd like to have the beautifier (default is generally what I end up ending, and its configured how I like except one this one thing)
(C/C++)

if (expr)
   thing();
else
   otherthing();

I want to force { braces } around the IF and the ELSE always -- so that it always comes:

if (expr)
{
   thing();
}

or :
if (expr)
{
  thing();
}
else
{
  things();
}

if (1 == 1)
 return;

becomes

if (1 == 1)
{
  return;
}

etc..

But I can't figure out to force that..

Any and all help appreciated!

patrick

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1682
  • Hero Points: 142
Re: Beautify-- need {} braces around all IF's, but don't know how.
« Reply #1 on: May 03, 2022, 06:33:13 pm »
We don't have a setting for adding in missing braces.  It has been requested before, so I'll update the feature request. 

It would definitely be useful when updating code from a different style that allowed brace-less control statements.