Author Topic: Problem with Alias  (Read 4760 times)

Wanderer

  • Senior Community Member
  • Posts: 557
  • Hero Points: 23
Problem with Alias
« on: April 08, 2008, 12:21:01 pm »
SlickEdit 13.0.0, WinXP, Vim emulation

Tools->Options->Languages->Application Languages->Visual Basic
    ->General
        I added my file's extension to the list of extensions
    ->Aliases
        I added an alias ('hdr') consisting of one line: ' Copyright MyMega Software Corp.

In my source file, I type my alias: hdr<space>
Nothing happens.

Alias for C/C++ works as expected.

Sandra

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 754
  • Hero Points: 35
Re: Problem with Alias
« Reply #1 on: April 08, 2008, 12:55:37 pm »
I assume that you are working in a file with the extension that you added to Visual Basic.  Does SlickEdit recognize this file as a Visual Basic file?  You can check by going to the Document menu while you have the file open in the current buffer.  There should be a couple of menu items that refer to the language mode (Select Mode (Visual Basic)... and Visual Basic Options).

Wanderer

  • Senior Community Member
  • Posts: 557
  • Hero Points: 23
Re: Problem with Alias
« Reply #2 on: April 08, 2008, 01:07:39 pm »
I assume that you are working in a file with the extension that you added to Visual Basic.  Does SlickEdit recognize this file as a Visual Basic file?  You can check by going to the Document menu while you have the file open in the current buffer.  There should be a couple of menu items that refer to the language mode (Select Mode (Visual Basic)... and Visual Basic Options).
Yes, I added my file extension to the list of extensions for Visual Basic.
Both "Select Mode (Visual Basic)..." and "Visual Basic Options..." are on the Document menu.

Sandra

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 754
  • Hero Points: 35
Re: Problem with Alias
« Reply #3 on: April 08, 2008, 01:46:23 pm »
Okay, that narrows it down a bit.  A couple more questions.

If you go back to the Visual Basic aliases, does your 'hdr' alias appear in the list?
Does this alias work in other Visual Basic files, for instance .bas or .vb files?

Wanderer

  • Senior Community Member
  • Posts: 557
  • Hero Points: 23
Re: Problem with Alias
« Reply #4 on: April 08, 2008, 02:02:27 pm »
If you go back to the Visual Basic aliases, does your 'hdr' alias appear in the list?
Yes
Quote
Does this alias work in other Visual Basic files, for instance .bas or .vb files?
Works as expected in a .vb file.

Sandra

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 754
  • Hero Points: 35
Re: Problem with Alias
« Reply #5 on: April 08, 2008, 02:39:22 pm »
What is the context that you're trying to expand the alias in?  If you expand the alias using the command 'expand-alias' instead of hitting space, does it work?

Thanks for your prompt replies!

Wanderer

  • Senior Community Member
  • Posts: 557
  • Hero Points: 23
Re: Problem with Alias
« Reply #6 on: April 08, 2008, 02:48:05 pm »
What is the context that you're trying to expand the alias in? 
First line of file, a blank line.
Quote
If you expand the alias using the command 'expand-alias' instead of hitting space, does it work?
Yes, that works.

.... and now using <space> does too...  Ghosts in the machine...

Perhaps clicking on Document->Select Mode (Visual Basic) made the difference?

Thanks for your help.

David_O

  • Senior Community Member
  • Posts: 152
  • Hero Points: 8
Re: Problem with Alias
« Reply #7 on: April 09, 2008, 03:29:12 pm »

More likely you were in a context that does not support expanding aliases on Space.  The most obvious cases of this are when inside a comment, even if the line is blank, and when it's not the last text of a line.  This is the case for most all languages, including VB and C/C++.  You can force the expansion by using Ctrl+Space in CUA emulation.  (The underlying command is codehelp_complete()).  Or you can use just Ctrl+Shift+O (expand_alias()).

Good luck,