Author Topic: View spaces in menu does not stay on  (Read 2367 times)

Raz1

  • Junior Community Member
  • Posts: 2
  • Hero Points: 0
View spaces in menu does not stay on
« on: February 04, 2014, 01:56:30 pm »
Hello,

I want to see all white spaces in all the files I open with SlickEdit. I know you can set manually to see the white spaces as dots by setting in menu View-Spaces. But this only shows the spaces on the active file, not every file, and also if I close it I'm going to loose the setting.

Can I set this View - Spaces permanently so that it will stay on for all files?

Graeme

  • Senior Community Member
  • Posts: 2009
  • Hero Points: 231
Re: View spaces in menu does not stay on
« Reply #1 on: February 05, 2014, 11:36:46 am »
Yes you can, per language.

In tools -> options, search for "spaces" (no quotes) and you'll see that in the "view" settings for each language you can select whether spaces should be shown with a special character or not.


Raz1

  • Junior Community Member
  • Posts: 2
  • Hero Points: 0
Re: View spaces in menu does not stay on
« Reply #2 on: February 05, 2014, 02:19:54 pm »
Let me know if I'm doing this right:

I did a Tools->Options->File Extension Setup, then the extension C is selected (because C++ which I use refers to C extension), and I cannot find the Spaces selection or anything like that, or View tab or anything related to that either. I am using SlickEdit Version 12.0.3.0.

I managed though to have line numbers permanently displayed in from General tab in here.
Am I missing something?

chrisant

  • Senior Community Member
  • Posts: 1413
  • Hero Points: 131
Re: View spaces in menu does not stay on
« Reply #3 on: February 05, 2014, 06:11:11 pm »
Tools > Options > Languages > Application Languages > C/C++, in the View tab.

Also, what Graeme what:  go to Tools > Options, then use the "Enter search text" box and type in "spaces" (without quotes), and the tree view will get filtered to show which nodes have settings related to "spaces".  You'll see the View tab for every language listed there.

Graeme

  • Senior Community Member
  • Posts: 2009
  • Hero Points: 231
Re: View spaces in menu does not stay on
« Reply #4 on: February 05, 2014, 10:58:32 pm »
I managed to find a user manual for slickedit version 12 (2007) and it doesn't appear to have this option.

The following code might give you what you want.  Create a file e.g. mymacros.e and load it using the load module command on the macro menu.  The _switchbuf_my_show_spaces macro runs automatically whenever you switch buffers.  The variable def_my_show_spaces controls whether there is no change (value 0), show spaces is enabled (1) or show spaces is disabled (2)).  To set the value of def_my_show_spaces, use the set macro variable command on the macro menu (or the set-var command on the command line).

Code: [Select]
#include "slick.sh"

#pragma option(strictsemicolons,on)
#pragma option(strict,on)
#pragma option(autodecl,off)
#pragma option(strictparens,on)


int def_my_show_spaces;

void _switchbuf_my_show_spaces()
{
   switch (def_my_show_spaces) {
      default:
      case 0 :
         return;
      case 1 :
         // show spaces
         if (p_ShowSpecialChars & SHOWSPECIALCHARS_SPACES)
            return;
         break;
      case 2 :
         // don't show spaces
         if (!(p_ShowSpecialChars & SHOWSPECIALCHARS_SPACES))
            return;
         break;
   }
   p_ShowSpecialChars^=SHOWSPECIALCHARS_SPACES;
   if (!_QReadOnly()) {
      update_format_line();
   }
}

chrisant

  • Senior Community Member
  • Posts: 1413
  • Hero Points: 131
Re: View spaces in menu does not stay on
« Reply #5 on: February 06, 2014, 02:18:22 am »
Oops, didn't notice the question was about v12.  The first version of SE I used was v12, and the first thing I did was write a macro very much like the one Graeme shared.  :)