Author Topic: C/C++: case statements indent setting ignored  (Read 181 times)

JeffB

  • Senior Community Member
  • Posts: 273
  • Hero Points: 10
C/C++: case statements indent setting ignored
« on: February 02, 2018, 05:43:43 am »
Under "C/C++ | Formatting | Edit... | Indent | Indent Rule Exceptions", I have the "'case statements' | Indent" setting set to "On"; however, whenever I type "case" or "default" under a switch statement, Slickedit either always starts in the column aligned with the "switch", or starts indented, but un-indents the line after it realizes I'm typing "case" or "default". The little sample screen in the options shows the correct behaviors as I turn the setting "On" or "Off", but the behavior in a actual edit window is always like the setting is "Off".
Code: [Select]
    switch (a) {
    case 1:
        break;
        case 2:
            break;
    }

"case 2" alignment is what I want (I manually indented it), but I always get "case 1" alignment.
Anyone else see this behavior ?

Jeff

patrick

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 843
  • Hero Points: 51
Re: C/C++: case statements indent setting ignored
« Reply #1 on: February 02, 2018, 02:00:07 pm »
You're on 22.0.2 22.0.1 I think. I'm not seeing that with a clean-ish config  Is the "indent width" under Indent Rule Exceptions -> 'case' statements is not set to something other than 0?

If you post your user.cfg.xml file from your configuration directory, I can take a closer look.  Maybe there's some way I'm overlooking that another setting can conflict with this one.
« Last Edit: February 02, 2018, 04:31:23 pm by patrick »

JeffB

  • Senior Community Member
  • Posts: 273
  • Hero Points: 10
Re: C/C++: case statements indent setting ignored
« Reply #2 on: February 02, 2018, 06:12:37 pm »
So the problem did not occur with new/fresh config directory.  I noticed that somewhere over the years, I ended up with a "My Default1" (note the 1 at the end) profile.  So the "indent_case" in user.cfg.xml was set to "0" for "My Default", and "1" for "My Default1".  "My Default1" was the chosen profile (according to GUI and user.cfg.xml), but switching to "My Default" and then back to "My Default1" corrected the issue.  I assume that somehow Slickedit was using "My Default" for running, even though "My Default1" was assigned and any configuration changes I made were being applied to it.  Anyway, it seems fine now...thanks.

Jeff