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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
|
# HG changeset patch
# User Neil <nyamatongwe@gmail.com>
# Date 1503646603 -36000
# Node ID b44bb3627bbd8ea7c41e9b7b35cf2910025c9519
# Parent 25eea2ed15fc97965212a2a03d5ef6978821f59b
Moved *StyleBits* APIs into deprecated category.
diff -r 25eea2ed15fc -r b44bb3627bbd include/Scintilla.h
--- a/include/Scintilla.h Sat Aug 19 10:44:32 2017 +1000
+++ b/include/Scintilla.h Fri Aug 25 17:36:43 2017 +1000
@@ -320,8 +320,6 @@
#define SCI_SETWHITESPACEBACK 2085
#define SCI_SETWHITESPACESIZE 2086
#define SCI_GETWHITESPACESIZE 2087
-#define SCI_SETSTYLEBITS 2090
-#define SCI_GETSTYLEBITS 2091
#define SCI_SETLINESTATE 2092
#define SCI_GETLINESTATE 2093
#define SCI_GETMAXLINESTATE 2094
@@ -988,7 +986,6 @@
#define SCI_GETPROPERTY 4008
#define SCI_GETPROPERTYEXPANDED 4009
#define SCI_GETPROPERTYINT 4010
-#define SCI_GETSTYLEBITSNEEDED 4011
#define SCI_GETLEXERLANGUAGE 4012
#define SCI_PRIVATELEXERCALL 4013
#define SCI_PROPERTYNAMES 4014
@@ -1216,6 +1213,10 @@
#define RangeToFormat Sci_RangeToFormat
#define NotifyHeader Sci_NotifyHeader
+#define SCI_SETSTYLEBITS 2090
+#define SCI_GETSTYLEBITS 2091
+#define SCI_GETSTYLEBITSNEEDED 4011
+
#endif
#endif
diff -r 25eea2ed15fc -r b44bb3627bbd include/Scintilla.iface
--- a/include/Scintilla.iface Sat Aug 19 10:44:32 2017 +1000
+++ b/include/Scintilla.iface Fri Aug 25 17:36:43 2017 +1000
@@ -702,14 +702,6 @@
# Get the size of the dots used to mark space characters.
get int GetWhitespaceSize=2087(,)
-# Divide each styling byte into lexical class bits (default: 5) and indicator
-# bits (default: 3). If a lexer requires more than 32 lexical states, then this
-# is used to expand the possible states.
-set void SetStyleBits=2090(int bits,)
-
-# Retrieve number of bits in style bytes used to hold the lexical state.
-get int GetStyleBits=2091(,)
-
# Used to hold extra styling information for each line.
set void SetLineState=2092(int line, int state)
@@ -2638,9 +2630,6 @@
# interpreted as an int AFTER any "$()" variable replacement.
get int GetPropertyInt=4010(string key, int defaultValue)
-# Retrieve the number of bits the current lexer needs for styling.
-get int GetStyleBitsNeeded=4011(,)
-
# Retrieve the name of the lexer.
# Return the length of the text.
# Result is NUL-terminated.
@@ -4875,6 +4864,17 @@
cat Deprecated
+# Divide each styling byte into lexical class bits (default: 5) and indicator
+# bits (default: 3). If a lexer requires more than 32 lexical states, then this
+# is used to expand the possible states.
+set void SetStyleBits=2090(int bits,)
+
+# Retrieve number of bits in style bytes used to hold the lexical state.
+get int GetStyleBits=2091(,)
+
+# Retrieve the number of bits the current lexer needs for styling.
+get int GetStyleBitsNeeded=4011(,)
+
# Deprecated in 3.5.5
# Always interpret keyboard input as Unicode
diff -r 25eea2ed15fc -r b44bb3627bbd src/Editor.cxx
--- a/src/Editor.cxx Sat Aug 19 10:44:32 2017 +1000
+++ b/src/Editor.cxx Fri Aug 25 17:36:43 2017 +1000
@@ -6971,12 +6971,15 @@
vs.ResetDefaultStyle();
InvalidateStyleRedraw();
break;
+
+#ifdef INCLUDE_DEPRECATED_FEATURES
case SCI_SETSTYLEBITS:
vs.EnsureStyle(0xff);
break;
case SCI_GETSTYLEBITS:
return 8;
+#endif
case SCI_SETLINESTATE:
return pdoc->SetLineState(static_cast<int>(wParam), static_cast<int>(lParam));
diff -r 25eea2ed15fc -r b44bb3627bbd src/ScintillaBase.cxx
--- a/src/ScintillaBase.cxx Sat Aug 19 10:44:32 2017 +1000
+++ b/src/ScintillaBase.cxx Fri Aug 25 17:36:43 2017 +1000
@@ -1092,8 +1092,10 @@
return reinterpret_cast<sptr_t>(
DocumentLexState()->PrivateCall(static_cast<int>(wParam), reinterpret_cast<void *>(lParam)));
+#ifdef INCLUDE_DEPRECATED_FEATURES
case SCI_GETSTYLEBITSNEEDED:
return 8;
+#endif
case SCI_PROPERTYNAMES:
return StringResult(lParam, DocumentLexState()->PropertyNames());
diff -r 25eea2ed15fc -r b44bb3627bbd test/lexTests.py
--- a/test/lexTests.py Sat Aug 19 10:44:32 2017 +1000
+++ b/test/lexTests.py Fri Aug 25 17:36:43 2017 +1000
@@ -75,9 +75,7 @@
self.ed.EmptyUndoBuffer()
self.ed.SetCodePage(65001)
self.ed.LexerLanguage = lexerName
- bits = self.ed.StyleBitsNeeded
- mask = 2 << bits - 1
- self.ed.StyleBits = bits
+ mask = 0xff
for i in range(len(keywords)):
self.ed.SetKeyWords(i, keywords[i])
|