aboutsummaryrefslogtreecommitdiffhomepage
path: root/cocoa/ScintillaView.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/ScintillaView.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/ScintillaView.mm')
-rw-r--r--cocoa/ScintillaView.mm8
1 files changed, 4 insertions, 4 deletions
diff --git a/cocoa/ScintillaView.mm b/cocoa/ScintillaView.mm
index ad8d7dc01..12e0495d6 100644
--- a/cocoa/ScintillaView.mm
+++ b/cocoa/ScintillaView.mm
@@ -565,7 +565,7 @@ static NSCursor *cursorFromEnum(Window::Cursor cursor)
else if ([aString isKindOfClass:[NSAttributedString class]])
newText = (NSString*) [aString string];
- mOwner.backend->InsertText(newText);
+ mOwner.backend->InsertText(newText, EditModel::CharacterSource::directInput);
}
//--------------------------------------------------------------------------------------------------
@@ -674,7 +674,7 @@ static NSCursor *cursorFromEnum(Window::Cursor cursor)
NSRange posRangeCurrent = mOwner.backend->PositionsFromCharacters(NSMakeRange(replacementRange.location, 0));
// Note: Scintilla internally works almost always with bytes instead chars, so we need to take
// this into account when determining selection ranges and such.
- ptrdiff_t lengthInserted = mOwner.backend->InsertText(newText);
+ ptrdiff_t lengthInserted = mOwner.backend->InsertText(newText, EditModel::CharacterSource::tentativeInput);
posRangeCurrent.length = lengthInserted;
mMarkedTextRange = mOwner.backend->CharactersFromPositions(posRangeCurrent);
// Mark the just inserted text. Keep the marked range for later reset.
@@ -2139,9 +2139,9 @@ sourceOperationMaskForDraggingContext: (NSDraggingContext) context
- (void)insertText: (id) aString
{
if ([aString isKindOfClass:[NSString class]])
- mBackend->InsertText(aString);
+ mBackend->InsertText(aString, EditModel::CharacterSource::directInput);
else if ([aString isKindOfClass:[NSAttributedString class]])
- mBackend->InsertText([aString string]);
+ mBackend->InsertText([aString string], EditModel::CharacterSource::directInput);
}
//--------------------------------------------------------------------------------------------------