50306
|
1 |
diff -ru 5.0.0/jEdit/org/gjt/sp/jedit/gui/StyleEditor.java 5.0.0/jEdit-patched/org/gjt/sp/jedit/gui/StyleEditor.java
|
|
2 |
--- 5.0.0/jEdit/org/gjt/sp/jedit/gui/StyleEditor.java 2012-11-17 16:41:58.000000000 +0100
|
|
3 |
+++ 5.0.0/jEdit-patched/org/gjt/sp/jedit/gui/StyleEditor.java 2012-12-01 17:34:47.000000000 +0100
|
|
4 |
@@ -79,7 +79,7 @@
|
48786
|
5 |
start = next;
|
|
6 |
token = token.next;
|
|
7 |
}
|
|
8 |
- if (token.id == Token.END || token.id == Token.NULL)
|
|
9 |
+ if (token.id == Token.END || (token.id % Token.ID_COUNT) == Token.NULL)
|
|
10 |
{
|
|
11 |
JOptionPane.showMessageDialog(textArea.getView(),
|
|
12 |
jEdit.getProperty("syntax-style-no-token.message"),
|
50306
|
13 |
diff -ru 5.0.0/jEdit/org/gjt/sp/jedit/syntax/Chunk.java 5.0.0/jEdit-patched/org/gjt/sp/jedit/syntax/Chunk.java
|
|
14 |
--- 5.0.0/jEdit/org/gjt/sp/jedit/syntax/Chunk.java 2012-11-17 16:42:25.000000000 +0100
|
|
15 |
+++ 5.0.0/jEdit-patched/org/gjt/sp/jedit/syntax/Chunk.java 2012-12-01 18:28:35.000000000 +0100
|
|
16 |
@@ -256,9 +256,9 @@
|
|
17 |
//{{{ Package private members
|
|
18 |
|
|
19 |
//{{{ Instance variables
|
|
20 |
- SyntaxStyle style;
|
|
21 |
+ public SyntaxStyle style;
|
|
22 |
// set up after init()
|
|
23 |
- float width;
|
|
24 |
+ public float width;
|
|
25 |
//}}}
|
|
26 |
|
|
27 |
//{{{ Chunk constructor
|
|
28 |
@@ -506,7 +506,7 @@
|
48786
|
29 |
// this is either style.getBackgroundColor() or
|
|
30 |
// styles[defaultID].getBackgroundColor()
|
|
31 |
private Color background;
|
|
32 |
- private String str;
|
|
33 |
+ public String str;
|
50306
|
34 |
private GlyphVector[] glyphs;
|
|
35 |
//}}}
|
|
36 |
|
|
37 |
diff -ru 5.0.0/jEdit/org/gjt/sp/jedit/syntax/Token.java 5.0.0/jEdit-patched/org/gjt/sp/jedit/syntax/Token.java
|
|
38 |
--- 5.0.0/jEdit/org/gjt/sp/jedit/syntax/Token.java 2012-11-17 16:42:25.000000000 +0100
|
|
39 |
+++ 5.0.0/jEdit-patched/org/gjt/sp/jedit/syntax/Token.java 2012-12-01 17:37:04.000000000 +0100
|
48786
|
40 |
@@ -57,7 +57,7 @@
|
|
41 |
*/
|
|
42 |
public static String tokenToString(byte token)
|
|
43 |
{
|
|
44 |
- return (token == Token.END) ? "END" : TOKEN_TYPES[token];
|
|
45 |
+ return (token == Token.END) ? "END" : TOKEN_TYPES[token % ID_COUNT];
|
|
46 |
} //}}}
|
|
47 |
|
|
48 |
//{{{ Token types
|
50306
|
49 |
diff -ru 5.0.0/jEdit/org/gjt/sp/util/SyntaxUtilities.java 5.0.0/jEdit-patched/org/gjt/sp/util/SyntaxUtilities.java
|
|
50 |
--- 5.0.0/jEdit/org/gjt/sp/util/SyntaxUtilities.java 2012-11-17 16:42:30.000000000 +0100
|
|
51 |
+++ 5.0.0/jEdit-patched/org/gjt/sp/util/SyntaxUtilities.java 2012-12-01 17:40:33.000000000 +0100
|
48786
|
52 |
@@ -194,7 +194,24 @@
|
|
53 |
{
|
|
54 |
return loadStyles(family,size,true);
|
|
55 |
}
|
|
56 |
-
|
|
57 |
+
|
|
58 |
+ /**
|
|
59 |
+ * Extended styles derived from the user-specified style array.
|
|
60 |
+ */
|
|
61 |
+
|
|
62 |
+ public static class StyleExtender
|
|
63 |
+ {
|
|
64 |
+ public SyntaxStyle[] extendStyles(SyntaxStyle[] styles)
|
|
65 |
+ {
|
|
66 |
+ return styles;
|
|
67 |
+ }
|
|
68 |
+ }
|
|
69 |
+ volatile private static StyleExtender _styleExtender = new StyleExtender();
|
|
70 |
+ public static void setStyleExtender(StyleExtender ext)
|
|
71 |
+ {
|
|
72 |
+ _styleExtender = ext;
|
|
73 |
+ }
|
|
74 |
+
|
|
75 |
/**
|
|
76 |
* Loads the syntax styles from the properties, giving them the specified
|
|
77 |
* base font family and size.
|
|
78 |
@@ -224,9 +241,9 @@
|
|
79 |
Log.log(Log.ERROR,StandardUtilities.class,e);
|
|
80 |
}
|
|
81 |
}
|
|
82 |
-
|
|
83 |
- return styles;
|
|
84 |
+ styles[0] = new SyntaxStyle(Color.black, null, new Font(family, 0, size));
|
|
85 |
+ return _styleExtender.extendStyles(styles);
|
|
86 |
} //}}}
|
|
87 |
-
|
|
88 |
+
|
|
89 |
private SyntaxUtilities(){}
|
|
90 |
}
|
50306
|
91 |
diff -ru 5.0.0/jEdit/org/gjt/sp/jedit/textarea/TextArea.java 5.0.0/jEdit-patched/org/gjt/sp/jedit/textarea/TextArea.java
|
|
92 |
--- 5.0.0/jEdit/org/gjt/sp/jedit/textarea/TextArea.java 2012-11-17 16:41:43.000000000 +0100
|
|
93 |
+++ 5.0.0/jEdit-patched/org/gjt/sp/jedit/textarea/TextArea.java 2012-12-01 17:28:12.000000000 +0100
|
|
94 |
@@ -906,6 +906,11 @@
|
|
95 |
return chunkCache.getLineInfo(screenLine).physicalLine;
|
|
96 |
} //}}}
|
|
97 |
|
|
98 |
+ public Chunk getChunksOfScreenLine(int screenLine)
|
|
99 |
+ {
|
|
100 |
+ return chunkCache.getLineInfo(screenLine).chunks;
|
|
101 |
+ }
|
|
102 |
+
|
|
103 |
//{{{ getScreenLineOfOffset() method
|
|
104 |
/**
|
|
105 |
* Returns the screen (wrapped) line containing the specified offset.
|
|
106 |
|