From d7e2afd1f88bf735b010461ff505470bfa468547 Mon Sep 17 00:00:00 2001 From: Zufu Liu Date: Sun, 30 Jun 2019 08:34:46 +1000 Subject: 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. --- cocoa/ScintillaView.mm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'cocoa/ScintillaView.mm') diff --git a/cocoa/ScintillaView.mm b/cocoa/ScintillaView.mm index 08eb0aa12..7d9e7780b 100644 --- a/cocoa/ScintillaView.mm +++ b/cocoa/ScintillaView.mm @@ -529,7 +529,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); } //-------------------------------------------------------------------------------------------------- @@ -622,7 +622,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. @@ -1965,9 +1965,9 @@ static NSCursor *cursorFromEnum(Window::Cursor cursor) { - (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); } //-------------------------------------------------------------------------------------------------- -- cgit v1.2.3