Author Topic: Case cursor positioning  (Read 2137 times)

dunkers

  • Senior Community Member
  • Posts: 688
  • Hero Points: 28
Case cursor positioning
« on: May 01, 2013, 11:29:04 pm »
Suppose I have a (C/C++) switch statement:
Code: [Select]
switch (blah) {
    case 'A':
        break;

    case|
}

The '|' shows where the cursor is. If I hit space I expect it now to look like this:
Code: [Select]
switch (blah) {
    case 'A':
        break;

    case |:
        break;
}

That is, the cursor is positioned ready for me to type the case parameter. What actually happens is that it looks like this:
Code: [Select]
switch (blah) {
    case 'A':
        break;

    case : |
        break;
}

This is new to V18 (i.e. V17 does it the expected way). I checked the C/C++ aliases and there are two different ones for case (one might be mine) but both specify the cursor as being before the colon.

Dennis

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 2920
  • Hero Points: 438
Re: Case cursor positioning
« Reply #1 on: May 02, 2013, 01:26:17 pm »
By default, there is one "Surround with" alias defined for case:
Code: [Select]
case %\c:
%\m sur_text -indent%
break;

I defined a second one for syntax expansion as follows:
Code: [Select]
case %\c:
%\ibreak;

I'm not seeing the problem you are seeing, could you post your case alias.  Also, do you indent with tabs?

patrick

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1238
  • Hero Points: 119
Re: Case cursor positioning
« Reply #2 on: May 02, 2013, 01:30:30 pm »
Are you on beta1?  I can reproduce your problem in beta1 once I add an alias for case, but it works in beta2.  There was a fix for some cursor position problems when beautify-alias/beautify-while-typing is enabled that went into beta 2.

If you are already on beta2, then could you post the text of your case alias, and the 'vusr_beautifier.xml' file that's in your SLICKEDITCONFIG directory?

dunkers

  • Senior Community Member
  • Posts: 688
  • Hero Points: 28
Re: Case cursor positioning
« Reply #3 on: May 02, 2013, 02:27:49 pm »
Yes, I was on beta 1 when I posted that. I've installed beta 2 and verified that it is fixed.

Thanks :)