Author Topic: switch and { formatting  (Read 81 times)

eda

  • Community Member
  • Posts: 17
  • Hero Points: 0
switch and { formatting
« on: January 17, 2018, 07:10:25 am »
I am using version 22.0.. If I do

    switch( x )
    {
       case
    ....

then slickedit keeps on moving my {. I do not want slickedit to move my carefully formatted { around. How do I stop it doing that.





Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 4066
  • Hero Points: 276
Re: switch and { formatting
« Reply #1 on: January 17, 2018, 06:25:04 pm »
Have you tweaked your Formatting settings (I assume for C++)? Brace Style for switch needs to be "Next Line". Indent>Indent Rule Exceptions: set case statement "indent" to 2 and "indent width" to 2. You may want Syntax Indent set to 2 to match your case statement indent but that depends on your coding style.

If you've already corrected your formatting settings and you are having problems, please post your user.cfg.xml from your config directory and indicate what language type you are editing so we don't have to guess.

JimmieC

  • Senior Community Member
  • Posts: 369
  • Hero Points: 13
Re: switch and { formatting
« Reply #2 on: Today at 02:28:59 pm »
SE fights me on switch\case as well. I have posted about it before. I would like an option to turn off formatting for switch\case only.