Author Topic: Comment after 'case' messes up indent level  (Read 2291 times)

jnairb

  • Senior Community Member
  • Posts: 228
  • Hero Points: 11
Comment after 'case' messes up indent level
« on: March 16, 2016, 10:41:20 pm »
I'm running v20.0.1.3 64-bit (Windows 7) with hotfix 6 applied, and just noticed an oddity in the auto-indent (C++) after a case statement that is followed by a line comment:
Code: [Select]
void test()
{
   int x;

   switch (x)
      {
      case 1:
         // test
      }
}
With the cursor following the "// test", when I press Enter, I'm on a new line with the cursor now in the same column as the start of the "case" statement rather than indented (aligned with the start of the comment).

If there's something other than a comment as the first line following the case, I can add a comment and the auto indent continues to work correctly following that comment. So it seems it's just a problem with the comment is the first line following the case.

patrick

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1471
  • Hero Points: 131
Re: Comment after 'case' messes up indent level
« Reply #1 on: March 17, 2016, 01:16:52 pm »
I can reproduce that.  I'll take a look at it.  It is hot-fixable, so I think I should be able to get it into the next hotfix.

jnairb

  • Senior Community Member
  • Posts: 228
  • Hero Points: 11
Re: Comment after 'case' messes up indent level
« Reply #2 on: March 31, 2016, 10:29:07 pm »
Did this fix not make it into hotfix 7? I still see the same indent problem.

patrick

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1471
  • Hero Points: 131
Re: Comment after 'case' messes up indent level
« Reply #3 on: April 01, 2016, 02:47:15 pm »
It looks like I messed this up.  Originally, I checked in a fix in the dev version SlickEdit we're running internally so it could get some testing time - the change is in some code shared by multiple languages.  And then we had a big merge, and it doesn't look like I merged this into the fix branch.  And it doesn't look right in the merge anyway, so let me figure out what happened.  I'll get it checked in for the hotfix, and I can send you the changed .e file if you want to load it up before the next hotfix is released.

Sorry about that.

patrick

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1471
  • Hero Points: 131
Re: Comment after 'case' messes up indent level
« Reply #4 on: April 06, 2016, 05:53:08 pm »
I've checked in a fix for, for real this time.  It will be in the next hotfix, or the 20.0.2 release, whichever comes first.