Author Topic: [SOLVED] Bizarre behaviour of Surround With alias  (Read 2488 times)

outsider

  • Community Member
  • Posts: 64
  • Hero Points: 1
[SOLVED] Bizarre behaviour of Surround With alias
« on: February 12, 2009, 04:48:22 pm »
Hi guys,

I'm editing a .cs file and just wanted to change the formatting for the if statement.
In the Alias Editor for cs.als I check the Surround With box. This automatically shows up the list of aliases that come pre-added. I select 'if' and then edit the alias to my liking.
When I invoke the alias however (either through the command line or through the context menu) none of the formatting changes show through - the default behaviour remains.

As a check, I added an 'if' alias without Surround With and this works perfectly.

The alias I have written is;

Code: [Select]
if( %\c )
{
%\m sur_text -indent%
}

But the output I get is equivalent to;

Code: [Select]
if ( %\c ) {
%\m sur_text -indent%
}

Now the odd thing is that I can add other text or escape sequences such as the date, and these do show up, so I know that the alias is definitely being picked up. I just can't eliminate the space after the 'if' and get the first opening brace to start on a new line!  ???

Any ideas on what I might be doing wrong? I'm sure it's something stupid.  :-\

thanks
« Last Edit: February 12, 2009, 05:47:19 pm by outsider »

outsider

  • Community Member
  • Posts: 64
  • Hero Points: 1
Re: [SOLVED] Bizarre behaviour of Surround With alias
« Reply #1 on: February 12, 2009, 05:48:30 pm »
Yep, it was something stupid alright.  ;D

You need to set the default behaviour of 'if' under File Extension Setup/Options as this will override what you write in your alias.