Code::Blocks Forums

Developer forums (C::B DEVELOPMENT STRICTLY!) => Development => Topic started by: yvesdm3000 on October 04, 2015, 03:57:46 pm

Title: New feature: whitespace colour
Post by: yvesdm3000 on October 04, 2015, 03:57:46 pm
I added a feature to CB to alter the colour of whitespace.

I think this should be base functionality, no idea if it can be implemented as a plugin or if it's worth it to do so...

Signed-off-by: Yves De Muyter <yves@alfavisio.be>
Title: Re: New feature: whitespace colour
Post by: oBFusCATed on October 04, 2015, 04:08:21 pm
Can you show a screenshot depicting the use case for this feature?
I'm not sure I understand why someone will choose different colour than the background colour in the syntax highlight.
Title: Re: New feature: whitespace colour
Post by: ollydbg on October 04, 2015, 04:16:06 pm
About this topic, some program like Notepad++ can show the "white space" and "tab" as a special characters(dot and arrow), see image shot below, which I though is a quite nice feature. :)

(http://imagizer.imageshack.us/v2/230x108q90/911/eAjLTz.png)

EDIT: it looks like C::B already has this feature. ;)
Title: Re: New feature: whitespace colour
Post by: yvesdm3000 on October 04, 2015, 04:31:42 pm
ollydbg : Good news,  Code::Blocks can do this allready !

But with latest SVN version, you can't alter it's colour, it simply uses the normal text colour and I find that a bit too intrusive.

In this screenshot, I altered the default to use a light grey. You hardly notice it unless you need it, which is way better than the black it had before. About any other editor that I know of and tried can do this, and once you get used to a feature and you change apps, you start to miss it...

A lot of other editors and Scintilla also allows you to set the whitespace background color and the size of the dot, but I don't really see the use for these extra features so I didn't add them (although it would be very easy to add them)

-Yves
Title: Re: New feature: whitespace colour
Post by: oBFusCATed on October 04, 2015, 05:13:20 pm
So this allows changing the colour of the white space special character when they are shown?

BTW: The screen shot doesn't show.
Title: Re: New feature: whitespace colour
Post by: yvesdm3000 on October 04, 2015, 07:58:32 pm
So this allows changing the colour of the white space special character when they are shown?

That's correct.

BTW: I updated the image with a better one.
Title: Re: New feature: whitespace colour
Post by: MortenMacFly on October 04, 2015, 08:14:30 pm
So this allows changing the colour of the white space special character when they are shown?
That's correct.
I like the idea. I wouldn't mind if this gets applied. I'll give it a try...
Title: Re: New feature: whitespace colour
Post by: oBFusCATed on October 04, 2015, 08:17:44 pm
yvesdm3000: Can you give us rgb values for the color you're using in the screen shot.
Title: Re: New feature: whitespace colour
Post by: yvesdm3000 on October 04, 2015, 09:06:23 pm
Does it matter what colour? The patch I've sent in gives you the choice to select the color and I honestly didn't give that much attention selecting any exact colour, the color I took might even be a little bit too bright.
In any case, if you intend to hardcode it, be aware that a lot of people have black backgrounds and will therefore need another colour (or shade of grey or any other colour like red as in the screenshot from Notepad++)

The colour that I seemed to have picked is #D2D2D2 (R=G=B=210 or H=0, S=0, V=82)

The attached screenshot shows how it's configured.

-Yves
Title: Re: New feature: whitespace colour
Post by: oBFusCATed on October 04, 2015, 09:09:03 pm
No, I don't want to hard code it, but I don't think black is a good default value.
Title: Re: New feature: whitespace colour
Post by: yvesdm3000 on October 04, 2015, 09:37:50 pm
Oh, I chose black because that was the colour it was before...

-Yves
Title: Re: New feature: whitespace colour
Post by: oBFusCATed on October 20, 2015, 01:32:53 am
In svn, a bit modified, thank you.