Bracket highlighting while line is commented out

Let us know what you would like to see in the next version of this software

Moderator: kfury77

Forum rules
Please follow these guidelines when posting feature requests. This will help to increase the value of your contribution.
  • Do not create new topics for already requested features. Add your comments to the existing feature request topics instead;
  • Create separate topic for each feature suggestion. Do NOT post a number of non-related feature suggestions in a single topic;
  • Give your topic a meaningful title. Do NOT create topics with meaningless titles, such as "My Suggestion" or "My Problem".
Please note that we DO READ all suggestions, even if a reply is not posted. Thanks!
Post Reply
bistromathics
Posts: 15
Joined: Mon Jul 12, 2010 9:28 pm

Bracket highlighting while line is commented out

Post by bistromathics »

It would be useful if matching brackets and parenthesis were highlighted inside commented code (when you place your cursor next to one). Sometimes you have to copy out a block from a very large piece of commented code, and it is also just a useful feature to more easily read large pieces of commented code. However, I'm not suggesting full syntax highlighting of commented code... that would just make everything else harder to read.
User avatar
Capricorn
Posts: 63
Joined: Fri Aug 06, 2010 11:37 am
Location: Germany!
Contact:

Re: Bracket highlighting while line is commented out

Post by Capricorn »

But what if I comment out code I do not want to be noticed by the bracket highlighter? A option must be needed to de- and activate the recognition of brackets in comments.
x3po
Posts: 139
Joined: Fri May 16, 2008 10:48 am

Re: Bracket highlighting while line is commented out

Post by x3po »

+1
User avatar
MikeyB
Top Contributor
Posts: 511
Joined: Fri Jun 09, 2006 10:38 am
Location: UK
Contact:

Re: Bracket highlighting while line is commented out

Post by MikeyB »

Have to say -1 for this.

If I comment out some code it's because I don't want anything to recognise it, how would the following situation be handled for example:

Code: Select all

if (test != 1) {
// if (test == 1) {
	alert("test is not 1");
}
Highlighting the brackets would end up in miss-matched brackets.

Actually, just tested this in WeBuilder and it does highlight the brackets in the comment, and never highlights the brackets on the 1st line. Not noticed this before.
Can be seen in this screenshot: Image
If the image doesn't show try this link: http://sites.google.com/site/swindonmike/comments
User avatar
mapleleaf
Posts: 121
Joined: Thu Oct 14, 2010 2:21 am
Location: Ashcroft, BC Canada
Contact:

Re: Bracket highlighting while line is commented out

Post by mapleleaf »

This is interesting as I do not get the same as you do
Image
as you can see the comment line has a curly bracket BUT it is in a different from or style
the curly brackets are highlighted correctly as seen in the image
Gatis
Blumentals Software Developer
Posts: 545
Joined: Sun Mar 05, 2006 12:30 am
Location: Latvia

Re: Bracket highlighting while line is commented out

Post by Gatis »

The green highlighting of brackets - means the brackets are highlighted using special algorithm, and the data is used also in code collapse (if there is added support for this inside the editor). And this does not work in strings or comments (at least it should not work).
The blue highlighting currently works also for brackets inside strings or comments, the data for these brackets is not used in code collapse.
We possibly could add an option for highlighting brackets in blue color inside comments or not, but currently this seems not a job of high priority.

Currently JavaScript embedded in HTML and simple JavaScript files work a bit differently. That is why Mikey sees a different picture, I guess.
With next version we will have code collapse also for JavaScript files, and then it will work similarly on both cases.

Still, it is strange that Mikey has character "{" highlighted no as a comment. Maybe the parser has been modified.. ? Try resetting it as described here:
http://forums.blumentals.net/viewtopic. ... 444#p16444
Kind regards,
Gatis Avots
User avatar
MikeyB
Top Contributor
Posts: 511
Joined: Fri Jun 09, 2006 10:38 am
Location: UK
Contact:

Re: Bracket highlighting while line is commented out

Post by MikeyB »

Hi Gatis,

I followed the instructions in the link, it reset the syntax colours, but still the { in the comment is highlighted:
Image

As you say, JavaScript within an HTML file works better:
Image
User avatar
mapleleaf
Posts: 121
Joined: Thu Oct 14, 2010 2:21 am
Location: Ashcroft, BC Canada
Contact:

Re: Bracket highlighting while line is commented out

Post by mapleleaf »

This is interesting, I took the code and placed it within JavaScript and as you can see matching brackets are highlighted whereas the comment line does not higlight the italic bracket

Image
Post Reply