Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
User name:
Password:
Save Password
Forgot your password?

 All Forums
 Visual Assist
 Feature Requests
 Highlighting matching square brackets
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Quexlaw
Junior Member

Germany
10 Posts

Posted - Apr 14 2019 :  10:06:19 AM  Show Profile  Reply with Quote
I'm using Unreal Engine 4 to develop plugins; plugins often make use of Unreal's Slate system, its UI framework to build custom editors.

Slate makes use of a lot of square brackets. However, proepr highlighting for square brackets don't seem to be supported. Square brackets do get highlighted, but seemingly at random and multiple at once, no matter if they match or not.

Having proper syntax highlighting for square brackets would be a much appreciated feature.

Kind regards

accord
Whole Tomato Software

United Kingdom
3155 Posts

Posted - Apr 14 2019 :  3:24:13 PM  Show Profile  Reply with Quote
Can you please post an example of how Slate uses square brackets?
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
15930 Posts

Posted - Apr 15 2019 :  10:33:37 AM  Show Profile  Reply with Quote
Are you exiting the Slate code inside Visual Studio? I have done a search, and found a Slate example here:

https://forums.unrealengine.com/community/community-content-tools-and-tutorials/61539-tutorial-slate-slistview-example

simply copying this code into a header file in VS2015, and then changing the foreground and background colour for VA's highlighting of matching brackets to be even more visible, I have this:



this is based on having turned On the setting:

VA Options -> Highlighting -> Highlight matching {} and () using ...

and changing the foreground and background colours for this setting, via:

IDE tools menu -> Options -> Environment -> Fonts and Colors -> Display items = VA Brace Matching

As you can see, everything is working correctly for me. Can you try this sample, from the URL, and see if you still get the problem highlighting?

If so, can you please try changing the VA highlighting colour to something distinct, to check if the odd highlighting you are seeing is actually coming from VA, and not from another source?

zen is the art of being at one with the two'ness

Edited by - feline on Apr 15 2019 10:35:11 AM
Go to Top of Page

Quexlaw
Junior Member

Germany
10 Posts

Posted - Apr 17 2019 :  12:10:05 PM  Show Profile  Reply with Quote
I changed the VA Brace Matching to a bright Cyan color like in your example, feline.

The result is that sometimes the cyan color, and sometimes a darker, blue color gets used which is probably the default Visual Studio highlighting.
When the caret is to the left of the bracket, the dark color gets used, if it's to the right, the VA color gets used. Additionally, if I put the caret on the left side (VS color), then put the caret to the left of another opening bracket, the previously VS colored bracket becomes VA colored, instead of being uncolored because it is no longer selected.

I made a short imgur album showcasing the problem:

https://imgur.com/a/Iw8B5pp

So it looks like I had a false assumption and it seems to be working as intended, just that VS highlighting is interfering/working somewhat differently from VA highlighting.
Is turning off VS highlighting encouraged?
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
15930 Posts

Posted - Apr 17 2019 :  12:36:48 PM  Show Profile  Reply with Quote
Turning off IDE features where they clash with a similar feature from VA often helps. It depends on which version / implementation you prefer. Here turning Off

IDE tools menu -> Options -> Text Editor -> C/C++ -> View -> Highlight Matching Tokens

should fix this problem for you. If not, then something else is going on as well.

Personally I prefer the VA highlighting method, since you don't have to place the caret onto one of the brackets to get the matching bracket highlighted, but this is a personal preference.

zen is the art of being at one with the two'ness
Go to Top of Page

Quexlaw
Junior Member

Germany
10 Posts

Posted - Apr 17 2019 :  1:17:07 PM  Show Profile  Reply with Quote
Thanks, that did the trick. :)
Also, the current context highlighting instead of having to select the bracket itself really is a neat feature.
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
15930 Posts

Posted - Apr 17 2019 :  3:10:01 PM  Show Profile  Reply with Quote
Current context highlighting is why I personally much prefer VA's highlighting.

Obviously if you do encounter a situation where the bracket highlighting is wrong please do tell us, preferably including a code sample, so I can try to figure out what is going wrong, and why.

zen is the art of being at one with the two'ness
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
© 2019 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000