From 82fe4c5665c0f4ee24c226314aae2edc39aae258 Mon Sep 17 00:00:00 2001 From: mitchell <70453897+667e-11@users.noreply.github.com> Date: Sun, 25 Nov 2018 01:08:21 -0500 Subject: Hijack `buffer:load_lexer_library()` to allow manual setting of input method. Apparently Mac OSX 10.14 is causing problems with GTK-OSX's normal input method switching. The input methods available are in Textadept.app's Contents/Resources/etc/gtk- 2.0/gtk.immodules file. Use the first string identifier. --- src/scintilla.patch | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'src/scintilla.patch') diff --git a/src/scintilla.patch b/src/scintilla.patch index b3d0a727..64bbf629 100644 --- a/src/scintilla.patch +++ b/src/scintilla.patch @@ -36,6 +36,7 @@ Revert caret block placement change introduced by Scintilla 3.7.3. const int offset = static_cast(posCaret.Position() - posLineStart); const XYPOSITION spaceWidth = vsDraw.styles[ll->EndLineStyle()].spaceWidth; const XYPOSITION virtualOffset = posCaret.VirtualSpace() * spaceWidth; +Temporary patch to send SC_UPDATE_SELECTION for multiple select. diff -r 6e368ee248e4 src/Editor.cxx --- a/src/Editor.cxx Fri Oct 26 11:06:34 2018 -0400 +++ b/src/Editor.cxx Sun Nov 04 09:06:53 2018 -0500 @@ -47,3 +48,24 @@ diff -r 6e368ee248e4 src/Editor.cxx ScrollRange(sel.RangeMain()); Redraw(); if (addNumber == addOne) +Hijack SCI_LOADLEXERLIBRARY for programmatically setting input method. +This is helpful on newer version of Mac OSX, where changing the input method is +flaky. +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,11 +821,11 @@ + case SCI_GETDIRECTPOINTER: + return reinterpret_cast(this); + +-#ifdef SCI_LEXER + case SCI_LOADLEXERLIBRARY: +- LexerManager::GetInstance()->Load(ConstCharPtrFromSPtr(lParam)); ++ // Hijack this interface to programmatically set input method. ++ gtk_im_multicontext_set_context_id(GTK_IM_MULTICONTEXT(im_context), ConstCharPtrFromSPtr(lParam)); + break; +-#endif ++ + case SCI_TARGETASUTF8: + return TargetAsUTF8(CharPtrFromSPtr(lParam)); + -- cgit v1.2.3