aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/scintilla.patch
blob: 9a525ae046e111ba88e020562d7bb57bf4f5c9a5 (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
Scintilla changes:

Only link the LPeg lexer.

Hijack SCI_LOADLEXERLIBRARY for programmatically setting input method.
This is helpful on newer versions of macOS, where changing the input method is
flaky.

--- a/src/Catalogue.cxx	Fri Dec 06 16:19:52 2013 +1100
+++ b/src/Catalogue.cxx	Sun Dec 15 21:21:20 2013 -0500
@@ -74,6 +74,7 @@
 // Shorten the code that declares a lexer and ensures it is linked in by calling a method.
 #define LINK_LEXER(lexer) extern LexerModule lexer; Catalogue::AddLexerModule(&lexer);
 
+#if 0
 //++Autogenerated -- run scripts/LexGen.py to regenerate
 //**\(\tLINK_LEXER(\*);\n\)
 	LINK_LEXER(lmA68k);
@@ -187,6 +188,8 @@
 	LINK_LEXER(lmYAML);
 
 //--Autogenerated -- end of automatically generated section
+#endif
+	LINK_LEXER(lmLPeg);
 
 	return 1;
 }
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));