aboutsummaryrefslogtreecommitdiffhomepage
path: root/cocoa/ScintillaCocoa.mm
diff options
context:
space:
mode:
authormitchell <unknown>2019-07-11 14:12:28 -0400
committermitchell <unknown>2019-07-11 14:12:28 -0400
commit2a15b94200abe8ee0df2dddc296f3dafd55655f8 (patch)
tree7236773c70225185fe1532d109a66f98c39e8d18 /cocoa/ScintillaCocoa.mm
parent55446b8967ed0a7f66502424d309f0b8fa74919f (diff)
downloadscintilla-mirror-2a15b94200abe8ee0df2dddc296f3dafd55655f8.tar.gz
Backport: Bug [#2038]. Source of input reported in SCN_CHARADDED.
This may be SC_CHARACTERSOURCE_DIRECT_INPUT, SC_CHARACTERSOURCE_TENTATIVE_INPUT, or SC_CHARACTERSOURCE_IME_RESULT. Backport of changeset 7613:4cfac35c71bd.
Diffstat (limited to 'cocoa/ScintillaCocoa.mm')
-rw-r--r--cocoa/ScintillaCocoa.mm6
1 files changed, 3 insertions, 3 deletions
diff --git a/cocoa/ScintillaCocoa.mm b/cocoa/ScintillaCocoa.mm
index b1b44ea00..b40743dad 100644
--- a/cocoa/ScintillaCocoa.mm
+++ b/cocoa/ScintillaCocoa.mm
@@ -2279,7 +2279,7 @@ bool ScintillaCocoa::KeyboardInput(NSEvent* event)
/**
* Used to insert already processed text provided by the Cocoa text input system.
*/
-ptrdiff_t ScintillaCocoa::InsertText(NSString *input) {
+ptrdiff_t ScintillaCocoa::InsertText(NSString *input, CharacterSource charSource) {
CFStringEncoding encoding = EncodingFromCharacterSet(IsUnicodeMode(),
vs.styles[STYLE_DEFAULT].characterSet);
std::string encoded = EncodedBytesString((CFStringRef)input, encoding);
@@ -2292,11 +2292,11 @@ ptrdiff_t ScintillaCocoa::InsertText(NSString *input) {
while (sv.length()) {
const unsigned char leadByte = sv[0];
const unsigned int bytesInCharacter = UTF8BytesOfLead[leadByte];
- InsertCharacter(sv.c_str(), bytesInCharacter);
+ InsertCharacter(sv.c_str(), bytesInCharacter, charSource);
sv = sv.substr(bytesInCharacter, sv.length());
}
} else {
- InsertCharacter(encoded.c_str(), static_cast<unsigned int>(encoded.length()));
+ InsertCharacter(encoded.c_str(), static_cast<unsigned int>(encoded.length()), charSource);
}
}
return encoded.length();