aboutsummaryrefslogtreecommitdiff
path: root/src/scintilla.patch
blob: 6850f62ff6784cb79c63afa984bc41b893f54e7a (plain)
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
Scintilla changes:

* Hijack SCI_LOADLEXERLIBRARY for programmatically setting input method.
  This is helpful on newer versions of macOS, where changing the input method is
  flaky.
* Update DrawTabArrowFn() signature in order to draw strikeout tabs.
* Handle leading whitespace in XPM images in order to prevent crashes.

diff -r 6e368ee248e4 gtk/ScintillaGTK.cxx
--- a/gtk/ScintillaGTK.cxx	Fri Oct 26 11:06:34 2018 -0400
+++ b/gtk/ScintillaGTK.cxx	Sun Nov 25 00:20:58 2018 -0500
@@ -821,6 +821,11 @@
 		case SCI_GETDIRECTPOINTER:
 			return reinterpret_cast<sptr_t>(this);
 
+		case SCI_LOADLEXERLIBRARY:
+			// Hijack this interface to programmatically set input method.
+			gtk_im_multicontext_set_context_id(GTK_IM_MULTICONTEXT(im_context), ConstCharPtrFromSPtr(lParam));
+			break;
+
 		case SCI_TARGETASUTF8:
 			return TargetAsUTF8(CharPtrFromSPtr(lParam));
 
diff -r 22b6bbb36280 src/EditView.cxx
--- a/src/EditView.cxx	Sat Sep 05 07:55:08 2020 +1000
+++ b/src/EditView.cxx	Fri Oct 02 19:34:46 2020 -0400
@@ -1951,7 +1951,7 @@
 							if (!customDrawTabArrow)
 								DrawTabArrow(surface, rcTab, segmentTop, vsDraw);
 							else
-								customDrawTabArrow(surface, rcTab, segmentTop);
+								customDrawTabArrow(surface, rcTab, segmentTop, vsDraw);
 						}
 					}
 				} else {
diff -r 22b6bbb36280 src/EditView.h
--- a/src/EditView.h	Sat Sep 05 07:55:08 2020 +1000
+++ b/src/EditView.h	Fri Oct 02 19:34:46 2020 -0400
@@ -40,7 +40,7 @@
 void DrawStyledText(Surface *surface, const ViewStyle &vs, int styleOffset, PRectangle rcText,
 	const StyledText &st, size_t start, size_t length, DrawPhase phase);
 
-typedef void (*DrawTabArrowFn)(Surface *surface, PRectangle rcTab, int ymid);
+typedef void (*DrawTabArrowFn)(Surface *surface, PRectangle rcTab, int ymid, const ViewStyle &vsDraw);
 
 class LineTabstops;
 
diff -r 22b6bbb36280 src/XPM.cxx
--- a/src/XPM.cxx	Sat Sep 05 07:55:08 2020 +1000
+++ b/src/XPM.cxx	Fri Oct 02 20:32:13 2020 -0400
@@ -92,6 +92,9 @@
 void XPM::Init(const char *textForm) {
 	// Test done is two parts to avoid possibility of overstepping the memory
 	// if memcmp implemented strangely. Must be 4 bytes at least at destination.
+	while (*textForm == ' ') {
+		textForm++;
+	}
 	if ((0 == memcmp(textForm, "/* X", 4)) && (0 == memcmp(textForm, "/* XPM */", 9))) {
 		// Build the lines form out of the text form
 		std::vector<const char *> linesForm = LinesFormFromTextForm(textForm);