diff options
author | Zufu Liu <unknown> | 2019-06-30 08:34:46 +1000 |
---|---|---|
committer | Zufu Liu <unknown> | 2019-06-30 08:34:46 +1000 |
commit | d7e2afd1f88bf735b010461ff505470bfa468547 (patch) | |
tree | 0305fc8fd126909438c6da42cf90d53a3201b8c2 /cocoa/ScintillaView.mm | |
parent | 24bff87107d89a09e724993e053e7151945596e8 (diff) | |
download | scintilla-mirror-d7e2afd1f88bf735b010461ff505470bfa468547.tar.gz |
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.
Diffstat (limited to 'cocoa/ScintillaView.mm')
-rw-r--r-- | cocoa/ScintillaView.mm | 8 |
1 files changed, 4 insertions, 4 deletions
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); } //-------------------------------------------------------------------------------------------------- |