Author Topic: Alias basics or killing me softly  (Read 4535 times)

mpulice

  • Community Member
  • Posts: 8
  • Hero Points: 0
Alias basics or killing me softly
« on: November 19, 2013, 06:54:01 pm »
So I am admittedly new to aliases and as such this may be my issue.

However, trying to create a very simple alias for a file section header like so
// -----------------------------------------------------------

Does some really weird things and I do not know why nor have I found answers via search.

I have tried to create the alias in C/C++ language and also using the selection Create Alias menu popup.  The issue is that when it expands the line above (whether its one line 2 lines 3 lines above) is copied and pasted along with the alias text.

So if I have a file like so...

#ifndef HEADER_FILE
#define HEADER_FILE

#define HEADER_FILE
// -------------------------------------------------

#endif


patrick

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1659
  • Hero Points: 141
Re: Alias basics or killing me softly
« Reply #1 on: November 19, 2013, 07:30:35 pm »
That sounds like something that's been fixed, but I'm not at my desk so I can verify when that was done.  What version are you running?  And what version of hotfixes are applied?


mpulice

  • Community Member
  • Posts: 8
  • Hero Points: 0
Re: Alias basics or killing me softly
« Reply #2 on: November 19, 2013, 08:43:06 pm »
Please note in addition to the below I have the same issue with the same packages on Windows 7 x64

SlickEdit 2013 (v18.0.1.2)

Licensed number of users: Single user
License file: /Library/Application Support/SlickEdit/18/slickedit.lic

Build Date: August 12, 2013
Emulation: Visual C++ 6

OS: Mac OS X Mavericks
OS Version: 10.9.0
Processor Architecture: Intel(R) Core(TM) i7-2820QM CPU @ 2.30GHz 64 bit (8 cores)

Memory: 77% Load, 6379MB/8192MB Virtual
Shell Info: /Applications/SlickEdit2013.app/Contents/MacOS/secsh -i
Screen Size: 1920 x 1200

Project Type: No project open
Language: No file open

Installation Directory: /Applications/SlickEdit2013.app/Contents/
Support/SlickEdit/18.0.1/

Hotfixes:
/Users/*****/Library/Application Support/SlickEdit/18.0.1/hotfixes/hotfix_se1801_12_cumulative.zip (Revision: 12)



Matthew

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 990
  • Hero Points: 44
Re: Alias basics or killing me softly
« Reply #3 on: November 19, 2013, 09:16:43 pm »
You probably want to add the escape sequence for the cursor position so the editor knows where to place the cursor after the expansion.
E.g.
Code: [Select]
//----------------------%\c
Did you create this as a "plain" alias or a "surround with" alias? If you don't recall, the way you can tell is by looking at the alias definition in the Tools > Options section (either under the Global aliases section or the per-language alias section.) Regular aliases have a lower-case "a" next to the icon, and surround with aliases have a lower case "s".

There's no reason for this type of alias to be a "Surround With" alias, but if you did create it like that, then it's good practice to be explicit about how to handle any selected text.
E.g.
Code: [Select]
//--------------------------
%\m begin_line%%\m sur_tex -endt%%\c

mpulice

  • Community Member
  • Posts: 8
  • Hero Points: 0
Re: Alias basics or killing me softly
« Reply #4 on: November 19, 2013, 09:31:17 pm »
It is a plain alias as well as being lang specific.  The reason it is lang specific is because I tried to make it global and that would not work at all let alone muck it up.

I'll add the escape and update after lunch.

Thanks for the tip.

mpulice

  • Community Member
  • Posts: 8
  • Hero Points: 0
Re: Alias basics or killing me softly
« Reply #5 on: November 19, 2013, 10:17:49 pm »
Ok, so I went and tried the escape and I get the same results.

Here is my about info for the Win 7 box

SlickEdit 2013 (v18.0.1.2 64-bit)

Serial number: WMX110493
Licensed number of users: Single user
License file: C:\ProgramData\slickedit\18\slickedit.lic

Build Date: August 12, 2013
Emulation: Visual C++ 6

OS: Windows 7 x64
OS Version: 6.01.7601  Service Pack 1
Memory: 50% Load, 3079MB/6056MB Physical, 3192MB/12111MB Page File, 252MB/8388607MB Virtual
Shell Info: C:\Windows\system32\cmd.exe /q
Screen Size: 1920 x 1080

Project Type: Gnuc
Language: .h (C/C++)

Installation Directory: C:\Program Files\SlickEditV18.0.1 x64\ (non-removable drive,NTFS,455608MB free)
Configuration Directory: C:\Users\mike\Documents\My SlickEdit Config\18.0.1\ (non-removable drive,NTFS,455608MB free)

Hotfixes:
C:\Users\mike\Documents\My SlickEdit Config\18.0.1\hotfixes\hotfix_se1801_12_cumulative.zip (Revision: 12)

patrick

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1659
  • Hero Points: 141
Re: Alias basics or killing me softly
« Reply #6 on: November 20, 2013, 02:38:12 pm »
Haven't reproduced it so far.  I may be defining my alias differently than you.

First, try this to help narrow it down:  Go to the Tools->Options dialog, and then go to Languages -> Application Language -> C/C++ -> General, and uncheck the "Beautify alias expansions" checkbox.  See if you can still reproduce the problem after that.

Second, could you collect the following two files from C:\Users\mike\Documents\My SlickEdit Config\18.0.1:  c.als.xml and vusr_beautifier.xml?    My suspicion is that I'll be able to reproduce the problem using those two files without having to try out a boatload of combinations of settings.  Hopefully, anyway.

mpulice

  • Community Member
  • Posts: 8
  • Hero Points: 0
Re: Alias basics or killing me softly
« Reply #7 on: November 20, 2013, 05:46:34 pm »
Hi Patrick

Thank you for the tip, problem resolved with un-checking beautify aliases.

I wonder if that will also resolve the issue I just noticed for doxygen function comments ?  :)

Regards
Mike

mpulice

  • Community Member
  • Posts: 8
  • Hero Points: 0
Re: Alias basics or killing me softly
« Reply #8 on: November 20, 2013, 05:55:12 pm »
Also, rectified my doxygen problem.

Thank you!! Off and running.

patrick

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1659
  • Hero Points: 141
Re: Alias basics or killing me softly
« Reply #9 on: November 20, 2013, 06:41:43 pm »
Good. 

It would help if you could still send me your c.als.xml and vusr_beautifier.xml file;  I still haven't found a setup that reproduces that problem, so I don't know what the underlying problem is yet.


mpulice

  • Community Member
  • Posts: 8
  • Hero Points: 0
Re: Alias basics or killing me softly
« Reply #10 on: November 20, 2013, 11:35:56 pm »
Attached, could not find a way to send them via PM.

mpulice

  • Community Member
  • Posts: 8
  • Hero Points: 0
Re: Alias basics or killing me softly
« Reply #11 on: November 20, 2013, 11:36:52 pm »
c.asl.xml

patrick

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1659
  • Hero Points: 141
Re: Alias basics or killing me softly
« Reply #12 on: November 21, 2013, 02:18:37 pm »
Thanks a lot, it will be a big help for tracking that down.