Author Topic: Default to "View Line Numbers" being ON?  (Read 13240 times)

takabanana

  • Community Member
  • Posts: 5
  • Hero Points: 0
Default to "View Line Numbers" being ON?
« on: July 19, 2007, 05:46:48 pm »
Hi everyone - I'm trying to get used to SlickEdit, finally... so I'm sure I will be having a ton of questions..

How do I get SlickEdit to show the Line Numbers by default on all opened files?

Thanks.


Rodney

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 750
  • Hero Points: 48
Re: Default to "View Line Numbers" being ON?
« Reply #1 on: July 19, 2007, 06:05:31 pm »
It is a per-extension setting (Tools>Options>File Extension Setup, General, Display line numbers).

--rodney

Sandra

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 754
  • Hero Points: 36
Re: Default to "View Line Numbers" being ON?
« Reply #2 on: July 19, 2007, 06:53:24 pm »
Funny that you should mention this.  Rodney is correct that it is a per-extension setting, but you can do it through macros.  How to turn this on for all for all files is actually a tutorial topic in our Slick-C Programming Doc.  Open up the Help, then navigate to Slick-C Macro Programming Guide > Tutorials > Turning on Line Numbers for all files.  This will give you step by step instructions on how to write a macro to turn on line numbers automatically for every file.  This'll give you some practice learning to write macros, too.  Good luck!

casterle

  • Junior Community Member
  • Posts: 3
  • Hero Points: 0
Re: Default to "View Line Numbers" being ON?
« Reply #3 on: September 19, 2008, 09:26:09 pm »
I'm using SlickEdit 13.0.2.0 and am not able to get this to work. The .ex file appears in the 'User-Loaded Modules' list, and I've exited/restarted SE but no joy.

Has something changed since this tutorial was written?

Sandra

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 754
  • Hero Points: 36
Re: Default to "View Line Numbers" being ON?
« Reply #4 on: September 22, 2008, 02:24:06 pm »
We did some reworking of the line numbers in 13.0.2, adding Automatic line numbers.  It seems the tutorial was not updated to reflect this change.  To get it working in 13.0.2, you only need add one line to your _buffer_add_ViewLineNumbers() function.  The function should now be:
Code: [Select]
void _buffer_add_ViewLineNumbers()
{
   p_LCBufFlags|=VSLCBUFFLAG_LINENUMBERS;
   p_line_numbers_len = _default_option(VSOPTION_LINE_NUMBERS_LEN);
}

Let me know if that doesn't work for you.  I'll enter a defect to get the docs updated for v14.

casterle

  • Junior Community Member
  • Posts: 3
  • Hero Points: 0
Re: Default to "View Line Numbers" being ON?
« Reply #5 on: September 22, 2008, 03:46:04 pm »
Hi Sandra,

I gave this a try, but still no luck. I'm sure I've got the macro right 'cause I cut & pasted from your message. I then unloaded my old version of the macro, loaded the new version, exited SE & restarted. There are still no line numbers in the open macro file.

Thanks,

Leroy

Sandra

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 754
  • Hero Points: 36
Re: Default to "View Line Numbers" being ON?
« Reply #6 on: September 22, 2008, 04:59:09 pm »
You will have to close and re-open the file to see the line numbers.  When SlickEdit is closed with a file open, then the buffer settings are saved for that file, so the line numbers setting will be saved and then restored when you re-open.  Try closing and re-opening the file to see if that helps.

casterle

  • Junior Community Member
  • Posts: 3
  • Hero Points: 0
Re: Default to "View Line Numbers" being ON?
« Reply #7 on: September 22, 2008, 06:26:31 pm »
That was it - thanks so much!