NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
Changing background colour of spaces and tabs
Veteran

Joined: 30 Aug 2006
Posts: 116
Reply with quote
Hi there,

I'm used to setting my colours so that all portions of a file that have some text, space, or tab has a background colour (helps me see extra and unecessary whitespaces), but I can't seem to figure this out.

If I change the "whitespace" bgcolor the whole file gets highlighted.

If I change every single colour syntax "element" (eg PHP functions, strings, etc) to a bg, all of it has a bgcolor except for actual spaces and tabs.

Here's an example of how it looks:



Here's how I want it to look:
View user's profileFind all posts by rudderSend private message


Joined: 08 Mar 2006
Posts: 63
Reply with quote
Why don't you just turn on the Show hidden characters display? Click the paragraph symbol button in the Editor toolbar or select the option in the View menu. It sounds like this will do what you want.
View user's profileFind all posts by svenaxSend private message
Veteran

Joined: 30 Aug 2006
Posts: 116
Reply with quote
Unfortunately I don't think that works. The hidden character symbols show but their background does not change colour. Even if it worked hidden characters are hugely inconvenient.

Here's what it looks like:



I do note that in an older version this seems to have been working fine, but it looks like it was later changed Sad.

See here for the request to change from the old way to the way it current works. What happened is that the definition of "whitespace" was changed so that it involved everything after the EOL.

syntax-coloring-t2180.html?highlight=background

Is there any way the developers might consider keeping the old functionality and the new under 2 different options?
View user's profileFind all posts by rudderSend private message


Joined: 08 Mar 2006
Posts: 63
Reply with quote
OK, I don't think I fully understand why you want this. Using Show hidden characters certainly will help you see any extra whitespace, but I suppose you have some other reason for wanting the background colored differently. Personally, I think it is very distracting to have large chunks of text with with a background different from the document color. But that is just me ...
View user's profileFind all posts by svenaxSend private message


Joined: 30 Aug 2006
Posts: 5
Reply with quote
I agree with rudder here. Homesite highlights all PHP code and it really helps it stand out from the HTML. It matters less now that my development is almost exclusively done with smarty templates (no more php in my html), but I had also attempted to find a way to highlight php blocks when I installed phped.
View user's profileFind all posts by ftwinnovationsSend private messageMSN Messenger
Site Admin

Joined: 13 Jul 2003
Posts: 8344
Reply with quote
it's not that hard to set a common background for all the php blocks, just set background colod for the Whitespace.
Do you have something more above this in Homesite? Smile
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 30 Aug 2006
Posts: 5
Reply with quote
Well, when you set the background for whitespace it colors the whole page, rather than just the whitespace characters.

This is how homesite colors whitepace + code (this is the second picture from the original post)

View user's profileFind all posts by ftwinnovationsSend private messageMSN Messenger
Site Admin

Joined: 13 Jul 2003
Posts: 8344
Reply with quote
Quote:
Well, when you set the background for whitespace it colors the whole page, rather than just the whitespace characters

Not really for whole page, but for a language. For example if you have php + html + js + css in one file and you set whitespace background for php, you'll get all php blocks colored differently than the others. It's quite convenient for some developers.

Regarding what you get in HomeSite, I agree with svenax, it's quite distracting.
View user's profileFind all posts by dmitriSend private messageVisit poster's website
Veteran

Joined: 30 Aug 2006
Posts: 116
Reply with quote
I just like that style of highlighting because I can easily see when other developers have added unecessary spaces and tab characters in the code (say at the end of code). It also helps me focus squarely on the code itself.

I find the current method really distracting, but who am I to say what is and what isn't if nobody else agrees with me? Sad. I would hazard a guess though, that while it seems minor, that this style of highlighting is the DEFAULT in Homesite... and if there are any other developers like me, who have stuck to Homesite for the past 5 years, they might also be used to this style of highlighting and might find switching to PHPED less jolting if they had this particular feature.
View user's profileFind all posts by rudderSend private message
Changing background colour of spaces and tabs
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 5 Hours  
Page 1 of 1  

  
  
 Reply to topic