forked from jrsoftware/issrc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
scintilla-patch.txt
215 lines (207 loc) · 8.8 KB
/
scintilla-patch.txt
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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
diff -r 9ccb2c951aed -r 21c761a47bb3 include/Scintilla.h
--- a/include/Scintilla.h Tue Jan 25 10:03:55 2011 +1100
+++ b/include/Scintilla.h Wed Jan 26 23:06:33 2011 -0600
@@ -124,6 +124,7 @@
#define SC_MARK_LEFTRECT 27
#define SC_MARK_AVAILABLE 28
#define SC_MARK_UNDERLINE 29
+#define SC_MARK_BACKFORE 3030
#define SC_MARK_CHARACTER 10000
#define SC_MARKNUM_FOLDEREND 25
#define SC_MARKNUM_FOLDEROPENMID 26
@@ -168,6 +169,7 @@
#define STYLE_CONTROLCHAR 36
#define STYLE_INDENTGUIDE 37
#define STYLE_CALLTIP 38
+#define STYLE_AUTOCOMPLETION 39
#define STYLE_LASTPREDEFINED 39
#define STYLE_MAX 255
#define SC_CHARSET_ANSI 0
diff -r 9ccb2c951aed -r 21c761a47bb3 src/AutoComplete.cxx
--- a/src/AutoComplete.cxx Tue Jan 25 10:03:55 2011 +1100
+++ b/src/AutoComplete.cxx Wed Jan 26 23:06:33 2011 -0600
@@ -132,7 +132,7 @@
char item[maxItemLen];
int start = 0; // lower bound of the api array block to search
int end = lb->Length() - 1; // upper bound of the api array block to search
- while ((start <= end) && (location == -1)) { // Binary searching loop
+ while (lenWord && (start <= end) && (location == -1)) { // Binary searching loop
int pivot = (start + end) / 2;
lb->GetValue(pivot, item, maxItemLen);
int cond;
diff -r 9ccb2c951aed -r 21c761a47bb3 src/Document.cxx
--- a/src/Document.cxx Tue Jan 25 10:03:55 2011 +1100
+++ b/src/Document.cxx Wed Jan 26 23:06:33 2011 -0600
@@ -1190,7 +1190,7 @@
if (pos > 0) {
CharClassify::cc ccPos = WordCharClass(CharAt(pos));
return (ccPos == CharClassify::ccWord || ccPos == CharClassify::ccPunctuation) &&
- (ccPos != WordCharClass(CharAt(pos - 1)));
+ (ccPos != WordCharClass(CharAt(NextPosition(pos, -1))));
}
return true;
}
@@ -1201,7 +1201,7 @@
*/
bool Document::IsWordEndAt(int pos) {
if (pos < Length()) {
- CharClassify::cc ccPrev = WordCharClass(CharAt(pos-1));
+ CharClassify::cc ccPrev = WordCharClass(CharAt(NextPosition(pos, -1)));
return (ccPrev == CharClassify::ccWord || ccPrev == CharClassify::ccPunctuation) &&
(ccPrev != WordCharClass(CharAt(pos)));
}
diff -r 9ccb2c951aed -r 21c761a47bb3 src/Editor.cxx
--- a/src/Editor.cxx Tue Jan 25 10:03:55 2011 +1100
+++ b/src/Editor.cxx Wed Jan 26 23:06:33 2011 -0600
@@ -2620,7 +2620,8 @@
if (!overrideBackground) {
int marks = pdoc->GetMark(line);
for (int markBit = 0; (markBit < 32) && marks; markBit++) {
- if ((marks & 1) && (vsDraw.markers[markBit].markType == SC_MARK_BACKGROUND) &&
+ if ((marks & 1) && ((vsDraw.markers[markBit].markType == SC_MARK_BACKGROUND) ||
+ (vsDraw.markers[markBit].markType == SC_MARK_BACKFORE)) &&
(vsDraw.markers[markBit].alpha == SC_ALPHA_NOALPHA)) {
background = vsDraw.markers[markBit].back.allocated;
overrideBackground = true;
@@ -2840,6 +2841,15 @@
if (vsDraw.hotspotForegroundSet)
textFore = vsDraw.hotspotForeground.allocated;
}
+
+ marks = pdoc->GetMark(line);
+ for (markBit = 0; (markBit < 32) && marks; markBit++) {
+ if ((marks & 1) && (vsDraw.markers[markBit].markType == SC_MARK_BACKFORE)) {
+ textFore = vsDraw.markers[markBit].fore.allocated;
+ }
+ marks >>= 1;
+ }
+
const int inSelection = hideSelection ? 0 : sel.CharacterInSelection(iDoc);
if (inSelection && (vsDraw.selforeset)) {
textFore = (inSelection == 1) ? vsDraw.selforeground.allocated : vsDraw.selAdditionalForeground.allocated;
@@ -3051,7 +3061,8 @@
}
marks = pdoc->GetMark(line);
for (markBit = 0; (markBit < 32) && marks; markBit++) {
- if ((marks & 1) && (vsDraw.markers[markBit].markType == SC_MARK_BACKGROUND)) {
+ if ((marks & 1) && ((vsDraw.markers[markBit].markType == SC_MARK_BACKGROUND) ||
+ (vsDraw.markers[markBit].markType == SC_MARK_BACKFORE))) {
SimpleAlphaRectangle(surface, rcSegment, vsDraw.markers[markBit].back.allocated, vsDraw.markers[markBit].alpha);
} else if ((marks & 1) && (vsDraw.markers[markBit].markType == SC_MARK_UNDERLINE)) {
PRectangle rcUnderline = rcSegment;
@@ -3272,6 +3283,15 @@
rcCaret.right = rcCaret.left + vsDraw.caretWidth;
}
ColourAllocated caretColour = mainCaret ? vsDraw.caretcolour.allocated : vsDraw.additionalCaretColour.allocated;
+
+ int marks = pdoc->GetMark(lineDoc);
+ for (int markBit = 0; (markBit < 32) && marks; markBit++) {
+ if ((marks & 1) && (vsDraw.markers[markBit].markType == SC_MARK_BACKFORE)) {
+ caretColour = vsDraw.markers[markBit].fore.allocated;
+ }
+ marks >>= 1;
+ }
+
if (drawBlockCaret) {
DrawBlockCaret(surface, vsDraw, ll, subLine, xStart, offset, posCaret.Position(), rcCaret, caretColour);
} else {
diff -r 9ccb2c951aed -r 21c761a47bb3 src/LineMarker.cxx
--- a/src/LineMarker.cxx Tue Jan 25 10:03:55 2011 +1100
+++ b/src/LineMarker.cxx Wed Jan 26 23:06:33 2011 -0600
@@ -155,7 +155,8 @@
surface->RectangleDraw(rcSmall, fore.allocated, back.allocated);
} else if (markType == SC_MARK_EMPTY || markType == SC_MARK_BACKGROUND ||
- markType == SC_MARK_UNDERLINE || markType == SC_MARK_AVAILABLE) {
+ markType == SC_MARK_UNDERLINE || markType == SC_MARK_AVAILABLE ||
+ markType == SC_MARK_BACKFORE) {
// An invisible marker so don't draw anything
} else if (markType == SC_MARK_VLINE) {
diff -r 9ccb2c951aed -r 21c761a47bb3 src/ScintillaBase.cxx
--- a/src/ScintillaBase.cxx Tue Jan 25 10:03:55 2011 +1100
+++ b/src/ScintillaBase.cxx Wed Jan 26 23:06:33 2011 -0600
@@ -220,7 +220,7 @@
}
}
ac.Start(wMain, idAutoComplete, sel.MainCaret(), PointMainCaret(),
- lenEntered, vs.lineHeight, IsUnicodeMode());
+ lenEntered, vs.styles[STYLE_AUTOCOMPLETION].lineHeight, IsUnicodeMode());
PRectangle rcClient = GetClientRectangle();
Point pt = LocationFromPosition(sel.MainCaret() - lenEntered);
@@ -250,8 +250,8 @@
rcac.right = rcac.left + widthLB;
rcac.bottom = Platform::Minimum(rcac.top + heightLB, rcPopupBounds.bottom);
ac.lb->SetPositionRelative(rcac, wMain);
- ac.lb->SetFont(vs.styles[STYLE_DEFAULT].font);
- unsigned int aveCharWidth = vs.styles[STYLE_DEFAULT].aveCharWidth;
+ ac.lb->SetFont(vs.styles[STYLE_AUTOCOMPLETION].font);
+ unsigned int aveCharWidth = vs.styles[STYLE_AUTOCOMPLETION].aveCharWidth;
ac.lb->SetAverageCharWidth(aveCharWidth);
ac.lb->SetDoubleClickAction(AutoCompleteDoubleClick, this);
@@ -275,9 +275,7 @@
rcList.bottom = rcList.top + heightAlloced;
ac.lb->SetPositionRelative(rcList, wMain);
ac.Show(true);
- if (lenEntered != 0) {
- AutoCompleteMoveToCurrentWord();
- }
+ AutoCompleteMoveToCurrentWord();
}
void ScintillaBase::AutoCompleteCancel() {
@@ -299,7 +297,10 @@
char wordCurrent[1000];
int i;
int startWord = ac.posStart - ac.startLen;
- for (i = startWord; i < sel.MainCaret() && i - startWord < 1000; i++)
+ int endWord = sel.MainCaret();
+ //if (ac.selectRestOfWord)
+ endWord = pdoc->ExtendWordSelect(endWord, 1, true);
+ for (i = startWord; i < endWord && i - startWord < 1000; i++)
wordCurrent[i - startWord] = pdoc->CharAt(i);
wordCurrent[Platform::Minimum(i - startWord, 999)] = '\0';
ac.Select(wordCurrent);
diff -r 9ccb2c951aed -r 21c761a47bb3 src/ViewStyle.cxx
--- a/src/ViewStyle.cxx Tue Jan 25 10:03:55 2011 +1100
+++ b/src/ViewStyle.cxx Wed Jan 26 23:06:33 2011 -0600
@@ -301,9 +301,9 @@
for (unsigned int i=0; i<stylesSize; i++) {
if (i != STYLE_DEFAULT) {
styles[i].Realise(surface, zoomLevel, &styles[STYLE_DEFAULT], extraFontFlag);
- if (maxAscent < styles[i].ascent)
+ if (maxAscent < styles[i].ascent && i != STYLE_AUTOCOMPLETION)
maxAscent = styles[i].ascent;
- if (maxDescent < styles[i].descent)
+ if (maxDescent < styles[i].descent && i != STYLE_AUTOCOMPLETION)
maxDescent = styles[i].descent;
}
if (styles[i].IsProtected()) {
diff -r 9ccb2c951aed -r 21c761a47bb3 win32/PlatWin.cxx
--- a/win32/PlatWin.cxx Tue Jan 25 10:03:55 2011 +1100
+++ b/win32/PlatWin.cxx Wed Jan 26 23:06:33 2011 -0600
@@ -1396,7 +1396,7 @@
};
const Point ListBoxX::ItemInset(0, 0);
-const Point ListBoxX::TextInset(2, 0);
+const Point ListBoxX::TextInset(2, 1);
const Point ListBoxX::ImageInset(1, 0);
ListBox *ListBox::Allocate() {
diff -r 9ccb2c951aed -r 21c761a47bb3 win32/ScintillaWin.cxx
--- a/win32/ScintillaWin.cxx Tue Jan 25 10:03:55 2011 +1100
+++ b/win32/ScintillaWin.cxx Wed Jan 26 23:06:33 2011 -0600
@@ -695,7 +695,9 @@
case WM_TIMER:
if (wParam == standardTimerID && timer.ticking) {
- Tick();
+ HWND capWnd = ::GetCapture();
+ if (!capWnd || capWnd == MainHWND())
+ Tick();
} else if (wParam == idleTimerID && idler.state) {
SendMessage(MainHWND(), SC_WIN_IDLE, 0, 1);
} else {
@@ -885,6 +887,7 @@
!(::IsChild(wThis, wOther) || (wOther == wCT))) {
SetFocusState(false);
DestroySystemCaret();
+ SetTicking(false);
}
}
//RealizeWindowPalette(true);