AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

How to change brace colour in SciTE?

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> General Chat
View previous topic :: View next topic  
Author Message
fogus



Joined: 28 Mar 2007
Posts: 28

PostPosted: Sat Apr 05, 2008 12:43 am    Post subject: How to change brace colour in SciTE? Reply with quote

Hello all,

For those of you who don't want to read this whole thing, basically I want to colour my braces independently from other parts of my program.

Quick question for you guys (Version 1.72):
I would like the braces (ie these things ---> (), {}, [] ) to be a different colour than my text.

I have been messing around with the cpp.properties and the SciTEGlobal.properties files for a long time. Then I went to google and searched endlessly.

I am programming in Java in a dark background.

In cpp.properties I have:
-----------------------------------------

keywordclass.java=abstract assert boolean break byte case catch char class \
const continue default do double else extends final finally float for future \
generic goto if implements import inner instanceof int interface long \
native new null outer package private protected public rest \
return short static super switch synchronized this throw throws \
transient try var void volatile while true false
keywords.*.java=$(keywordclass.java)

...

# Keyword
style.cpp.5=fore:#cc0000

...

# Keywords2
style.cpp.16=fore:#CC6600

------------------------------------------------------

Now, what I thought I should do would be to add on the symbols I want to the end of the keywords part, like:
keywordclass.java=abstract assert boolean break byte case catch char class \
...
transient try var void volatile while true false { } ( ) [ ]
keywords.*.java=$(keywordclass.java)

But that doesn't do anything. When I add my own words it works fine. (like "dog" and "bark"). SciTE doesn't seem to recognize brackets as keywords.

What I really want to do is to have my brackets a different colour than my keywords. I'm thinking a light purple (dark background remember). My keywords are in fire engine red. Could I have them part of my own keywords2.java or keywordsclass2.java? Maybe even put other things in there too? That would be just dandy. I have no idea how to do it.

One last thing, has anyone found a way to have the braces rotate through a variety of colours (so they don't all look the same)? I know I've seen it done before.

Cheers everyone,
Back to top
View user's profile Send private message
PhiLho



Joined: 27 Dec 2005
Posts: 6721
Location: France (near Paris)

PostPosted: Fri Apr 25, 2008 5:04 pm    Post subject: Reply with quote

Braces and brackets are not keywords, they are operators. These are specifically handled by the lexer (hard-coded).

The color of operators in the CPP lexer is controlled by the style.cpp.10 style.
You cannot separate braces/brackets from +-*/ etc. with the current lexer. Although you can change the lexer to fit your needs, shouldn't be too hard for a Java programmer (but you need to recompile Scintilla).

I don't think you can do "color rotating" or similar.
_________________
vPhiLho := RegExReplace("Philippe Lhoste", "^(\w{3})\w*\s+\b(\w{3})\w*$", "$1$2")
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> General Chat All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group