Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
nano default syntax highlighting/colouring behaviour broken?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
meowsqueak
Veteran
Veteran


Joined: 26 Aug 2003
Posts: 1549
Location: New Zealand

PostPosted: Tue Feb 14, 2006 1:36 am    Post subject: nano default syntax highlighting/colouring behaviour broken? Reply with quote

I'm not understanding something here...

nano-1.3.9

If I have this in my ~/.nanorc:

Code:
syntax "default"
color red "^[ \t]*#.*"


then 'generic' (i.e. no extension) text files seem to have some sort of weird syntax colouring, where words like 'if' and 'time' are green as is '=', and 'cp' is blue. Most other words are plain (white). No, this isn't a shell script I'm looking at, and nothing is red either.

My /etc/nanorc has nothing except an ebuild rule enabled.

If I comment out that bit above, the file is completely plain text as I'd expect.

There are no other rules that apply - if there were, then commenting out the default section wouldn't change the situation.

I tried a file with just this in it:
Code:
syntax "default"


Well, that triggers this strange behaviour too! It's almost as if the default behaviour is hard-coded and although it's enabled by the syntax "default" line, it's ignoring the subsequent directives.

That pattern used to make # comments in generic files red, but this seems totally broken now.

keywords: nano syntax color colour highlight default nanorc
Back to top
View user's profile Send private message
bensberg
n00b
n00b


Joined: 09 Mar 2005
Posts: 36

PostPosted: Fri May 26, 2006 12:30 pm    Post subject: Re: nano default syntax highlighting/colouring behaviour bro Reply with quote

meowsqueak wrote:
Code:
syntax "default"
color red "^[ \t]*#.*"

That pattern used to make # comments in generic files red, but this seems totally broken now.

It should be fixed when 1.3.12 comes out. Meanwhile, have you tried this instead:
Code:
syntax "default"
color red "^[[:space:]]*#.*$"

Myself I use:
Code:
syntax "default"
color red "^.+$"
color blue "^[[:space:]]*#.*$"
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
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