aboutsummaryrefslogtreecommitdiffhomepage
path: root/cocoa/ScintillaCocoa.mm
diff options
context:
space:
mode:
Diffstat (limited to 'cocoa/ScintillaCocoa.mm')
-rw-r--r--cocoa/ScintillaCocoa.mm15
1 files changed, 15 insertions, 0 deletions
diff --git a/cocoa/ScintillaCocoa.mm b/cocoa/ScintillaCocoa.mm
index dfe2e47d1..d8dd6ae7b 100644
--- a/cocoa/ScintillaCocoa.mm
+++ b/cocoa/ScintillaCocoa.mm
@@ -1930,6 +1930,21 @@ void ScintillaCocoa::SelectOnlyMainSelection()
}
//--------------------------------------------------------------------------------------------------
+/**
+ * When switching documents discard any incomplete character composition state as otherwise tries to
+ * act on the new document.
+ */
+void ScintillaCocoa::SetDocPointer(Document *document)
+{
+ // Drop input composition.
+ NSTextInputContext *inctxt = [NSTextInputContext currentInputContext];
+ [inctxt discardMarkedText];
+ InnerView *inner = ContentView();
+ [inner removeMarkedText];
+ Editor::SetDocPointer(document);
+}
+
+//--------------------------------------------------------------------------------------------------
/**
* Called by the owning view when the mouse pointer enters the control.