jEdit Community - Resources for users of the jEdit Text Editor
Color per mode, not global color and adding new color type
Submitted by Baldurien on Wednesday, 12 October, 2005 - 13:32
Hi,

I'm working with a four-mixing language (xhtml+css+javascript+php and certain time a five one). and usually I use keyword1 for language structure (so, for js & php, it would be if, elseif, else, etc) but when it come to CSS, i would like to use different colors :

For CSS1 properties (ex: display), i would like this to be keyword1, for CSS2.1 (ex; z-index) i would like this to be keyword2, etc for values. The fact is when i'm in multi mode, or even in CSS mode, the keyword1 is dedicated to language structure.

The feature missing here in jEdit is a color setting per mode. For example, when I'm in CSS mode, I'd like to have CSS mode colors, when I'm in Java mode, I'd like to have Java mode colors, etc.

So as a feature, it could be good to have the abilities to have color set per languages.

Also, other thing I noted is that we don't what represent KEYWORD1, etc. For my CSS, I would like to replace the "KEYWORD1" label (in the Global Options > Syntax highlight) by "CSS 1.0 Properties").

It could be added in the xml with a tag :

COLORSHEME
COLOR NAME="xxx" TITLE="CSS 1.0 Properties" DEFAULT="KEYWORD1" /
/COLORSHEME

In this case, NAME is the name of the color : it could be used in TYPE to add our colour (ex: for a multi mode like php, I may have PHP_INSTRUCTION, PHP_VARIABLE, etc), TITLE is the title of the colour, to describe what it does, and finally DEFAULT would be the default value for the color (if not set in the theme)
Comment viewing options
Select your preferred way to display the comments and click 'Save settings' to activate your changes.
I addition to what I said, I
by Baldurien on Wed, 12/10/2005 - 17:30
I addition to what I said, I found a way to add new colors : I downloaded the source, and in them, I opened /org/gjt/sp/jedit/syntax/Token.java : public String array TOKEN_TYPES contains all the type as textual (in fact, I think that is what you may see in Syntax Highlighting pane, in global options).

You must add as much item as needed (I added SPECIAL1 to SPECIAL10), then you'll have to add 10 constants that own the same name SPECIAL1, ..., SPECIAL10. Their value is in fact an index in the TOKEN_TYPES array : for me, the range of value was 19 to 28.

Then, change ID_COUNT to 29 and it work for the recognization in rule.

Now you have to edit /org/gjt/sp/jedit/jedit.props. Find one of view.style.keyword1, and add view.style.special1 to view.style.special10 (and copy the value of another view.style props)

Just recompile and you will be able to use those new token type.

Since, if I've got the time, I think I will try to implement my idea (of per style mode, and color sheme).
User login
Browse archives
« April 2024  
MoTuWeThFrSaSu
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
 
Poll
Are you interested in language packs for jEdit?
Yes, and I could help maintain translations
26%
Yes, I'd like to have translations
32%
Indifferent
35%
No, that'd be bad (please comment)
7%
Total votes: 1093
Syndication
file   ver   dls
German Localization light   4.4.2.1   82348
Context Free Art (*.cfdg)   0.31   46055
JBuilder scheme   .001   18495
BBEdit scheme   1.0   18116
ColdFusion scheme   1.0   18024
R Edit Mode - extensive version   0.1   17473
Advanced HTML edit mode   1.0   16206
Matlab Edit Mode   1.0   16068
jEdit XP icons   1.0   15229
XP icons for jEdit   1.1   14293