Author Topic: Colors and Formating  (Read 1612 times)

SeeCwriter

  • Senior Community Member
  • Posts: 131
  • Hero Points: 1
Colors and Formating
« on: July 11, 2019, 06:49:25 pm »
Using SE Pro v23.0.2.0, with Hotfix 2302_2. I'm still trying to get SE operating like it was on my old (dead) PC.
I have SE configured to add spaces around function arguments, and operators. It used to be that when I typed a statement such as "a=b+c;", when I hit the Enter key it would format it as "a = b + c;". Now it does nothing. I have tried it with Adaptive Formatting enabled in All Languages with all checkboxes selected, and with Adaptive Formatting disabled. It made no difference. I know that on my previous PC I had Adaptive Formatting disabled because it was doing something I didn't like, but I don't remember what it was.

I also have "Begin/End style" set to "Next Line". This works for an "if" statement, but it doesn't for the "else" portion. When I type "else", whether leaving the cursor after the 'e' or entering a space after the 'e', and type an open brace, '{', it puts the open brace where the cursor is and puts the closing brace on the next line, indented at the correct place. It used to put the open brace on the next and the closing brace on the line after.

For colors I am using the default color scheme of "Light:Default", and haven't made any changes to the default settings. All the colors in the General, Selections, and Comments sections match what I'm seeing, except for "Function" under General. The color for functions in the Color Options dialog is a foreground of black bold, and a background of white. And the sample text matches.  But the functions in my files are all a burnt orange color. Now, there is also a "Symbol Coloring" option dialog.  I open that and the profile is set to "All symbols - Default".  And when I look through the "Rule name" and  "Symbol declaration" list, all the various functions are shown as that burnt orange color. So the function color must be coming from this dialog. The color of the other symbols in the "Symbols Coloring" dialog seem to match the default colors of the "Colors" dialog, only the functions appear to be different. Is there a reason for this, and more importantly, can I disable what "Symbol Coloring" is doing?

Edit: In the Symbol Coloring dialog, the description says to select the (None) scheme to disable symbol coloring. I can't find a place to enter (None). But reading further, which I didn't do before, it also says that symbol coloring can be disabled in the View options for each lanaguage. Disabling it in the View removed the orange color. So the coloring issue is solved.
« Last Edit: July 11, 2019, 06:58:55 pm by SeeCwriter »

Dennis

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 2787
  • Hero Points: 422
Re: Colors and Formating
« Reply #1 on: July 11, 2019, 07:59:57 pm »
It is very easy to disable Symbol Coloring. 

   View > Symbol Coloring > uncheck "Enable Symbol Coloring"

Or you can set it in the language options:

   View > C/C++ View Options... > uncheck "Symbol Coloring"

patrick

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1124
  • Hero Points: 105
Re: Colors and Formating
« Reply #2 on: July 11, 2019, 08:39:32 pm »
For the spaces around operators, if you had "Beautify while typing" enabled in the General page for C/C++, then the operators would be respaced when you hit the semicolon or a brace.  I don't think it's activated on enter except for on completions or alias expansions.

I think that may account for your brace style for the else as well.  (though I need to double check that, I thought we forced the brace into the right spot for ELSE even without that turned on).

SeeCwriter

  • Senior Community Member
  • Posts: 131
  • Hero Points: 1
Re: Colors and Formating
« Reply #3 on: July 12, 2019, 03:54:39 pm »
Enabling "Beautify while typing" solved both issues.

The other issue, or rather annoyance, is the mouse-over feature, where a pop-up appears to show the definition of the element and a green arrow to jump to it. About half the time I get no pop-up. I don't mean that sometimes I get a pop-up for an element and at other times I don't. Rather, there are a number of variables, functions, and #defines that never get the mouse-over pop-up. I think the tag files are used for this feature, so I selected "Retag Workspace..." and "Retag Project...", but it made no difference. I've gone through the "Context Tagging" options, for both the glogal settings and the language specific settings, and nothing I did there made a difference.  I also don't get any pop-ups for common system library functions, such as strcpy, strlen, printf, etc., as I used to.



Dennis

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 2787
  • Hero Points: 422
Re: Colors and Formating
« Reply #4 on: July 16, 2019, 02:21:10 pm »
Could I have an example where the mouse-over popup does not work for you?  If you are not getting popups for common library functions, it makes me think maybe you need to build/rebuild your compiler tag file.  Go to Document > C/C++ Options > Tag Files... to do this.

Dennis

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 2787
  • Hero Points: 422
Re: Colors and Formating
« Reply #5 on: July 17, 2019, 07:49:04 pm »
Your mouse-over issues may be solved by the forthcoming hot fix for the following:

https://community.slickedit.com/index.php/topic,16992.0.html

SeeCwriter

  • Senior Community Member
  • Posts: 131
  • Hero Points: 1
Re: Colors and Formating
« Reply #6 on: July 18, 2019, 03:04:16 pm »
I will wait for the hotfix to see if it fixes the mouse-over issue.

As for compiler tag files, in all the years of using SE I've never created a compiler-specific tag file. And there are no files listed in the C/C++ Options > Tag Files... window to build/rebuild.

SeeCwriter

  • Senior Community Member
  • Posts: 131
  • Hero Points: 1
Re: Colors and Formating
« Reply #7 on: July 19, 2019, 04:28:07 pm »
This was working at one time, but SE is back to ignoring my brace setting of putting open and closing braces on their own lines:
Code: [Select]
// This is what I want.
void func()
{
    // do stuff
}

// This is what I get
void func() {
    // do stuff
 }
It doesn't matter where the cursor is, at the end of the line or on the next line under the function, it always puts the open brace at the end of the function, or if, or else, or everything.

I've tried it with adaptive formatting enabled and disabled. There is a "Begin/end style" setting in adaptive formatting. I don't know what it does, but tried it both enabled and disabled, and it made no difference.

In the All Languages->Formatting section the "Begin/end style" is set to "next line", and the 2-checkboxes are unchecked.
In the Application Languages->C/C++->Formatting section, the Brace Style settings are set to "Next Line" for every statement option. And the Code Preview shows the braces in the correct position.
Yet, the braces are not put in the correct position. What else is there to do?

patrick

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1124
  • Hero Points: 105
Re: Colors and Formating
« Reply #8 on: July 19, 2019, 05:13:03 pm »
I thought that turning on beautify while typing took care of that.  Or is there is difference I missed out on?

In any case, probably the easiest thing to do now is for you to post the user.cfg.xml from your config directory.  That way I can just run with your config and see what's going on.

SeeCwriter

  • Senior Community Member
  • Posts: 131
  • Hero Points: 1
Re: Colors and Formating
« Reply #9 on: July 19, 2019, 08:20:42 pm »
Turning on beautify while typing did solve the issue for a while. And it's still enabled. I haven't changed anything.

patrick

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1124
  • Hero Points: 105
Re: Colors and Formating
« Reply #10 on: July 19, 2019, 09:16:53 pm »
Using your configuration, just typing in those examples in to a empty file c++ works for me.  Same with if and while statements, etc...  Config looks fine.

If I bring up a source file that has functions with the braces on the same line as the function declaration, then functions I add will have the braces on the same line, because adaptive formatting is enabled, and it's picking up on that file's style. So I'd say turn off adaptive formatting for the moment, since we don't want it interfering with the brace placement when we're trying to figure out what's going on. 

With adaptive formatting off, does this happen everywhere, or just in certain files?   Is there a small example file that does that you can share?   Hmm, also bring up a file you're having a problem with, and go to the Document menu to see if the right language mode is set.  (If it's C++, there should be a "C/C++ Options" entry in that menu).