aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--cocoa/ScintillaCocoa.h2
-rw-r--r--cocoa/ScintillaCocoa.mm6
-rw-r--r--cocoa/ScintillaView.mm8
-rw-r--r--doc/ScintillaDoc.html42
-rw-r--r--doc/ScintillaHistory.html5
-rw-r--r--gtk/ScintillaGTK.cxx7
-rw-r--r--include/Scintilla.h4
-rw-r--r--include/Scintilla.iface11
-rw-r--r--qt/ScintillaEditBase/ScintillaEditBase.cpp9
-rw-r--r--src/EditModel.h2
-rw-r--r--src/Editor.cxx13
-rw-r--r--src/Editor.h4
-rw-r--r--src/ScintillaBase.cxx8
-rw-r--r--src/ScintillaBase.h2
-rw-r--r--win32/ScintillaWin.cxx19
15 files changed, 95 insertions, 47 deletions
diff --git a/cocoa/ScintillaCocoa.h b/cocoa/ScintillaCocoa.h
index f34d7c31d..0eb758ddc 100644
--- a/cocoa/ScintillaCocoa.h
+++ b/cocoa/ScintillaCocoa.h
@@ -197,7 +197,7 @@ public:
void ObserverRemove();
void IdleWork() override;
void QueueIdleWork(WorkNeeded::workItems items, Sci::Position upTo) override;
- ptrdiff_t InsertText(NSString *input);
+ ptrdiff_t InsertText(NSString *input, CharacterSource charSource);
NSRange PositionsFromCharacters(NSRange rangeCharacters) const;
NSRange CharactersFromPositions(NSRange rangePositions) const;
NSString *RangeTextAsString(NSRange rangePositions) const;
diff --git a/cocoa/ScintillaCocoa.mm b/cocoa/ScintillaCocoa.mm
index 0ce912f54..bc6bb3698 100644
--- a/cocoa/ScintillaCocoa.mm
+++ b/cocoa/ScintillaCocoa.mm
@@ -2175,7 +2175,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) {
if ([input length] == 0) {
return 0;
}
@@ -2190,7 +2190,7 @@ ptrdiff_t ScintillaCocoa::InsertText(NSString *input) {
while (sv.length()) {
const unsigned char leadByte = sv[0];
const unsigned int bytesInCharacter = UTF8BytesOfLead[leadByte];
- InsertCharacter(sv.substr(0, bytesInCharacter));
+ InsertCharacter(sv.substr(0, bytesInCharacter), charSource);
sv.remove_prefix(bytesInCharacter);
}
return encoded.length();
@@ -2203,7 +2203,7 @@ ptrdiff_t ScintillaCocoa::InsertText(NSString *input) {
std::string encoded = EncodedBytesString((__bridge CFStringRef)character,
encoding);
lengthInserted += encoded.length();
- InsertCharacter(encoded);
+ InsertCharacter(encoded, charSource);
}
return lengthInserted;
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);
}
//--------------------------------------------------------------------------------------------------
diff --git a/doc/ScintillaDoc.html b/doc/ScintillaDoc.html
index 9ef5b3055..b96f6eea2 100644
--- a/doc/ScintillaDoc.html
+++ b/doc/ScintillaDoc.html
@@ -3818,7 +3818,7 @@ struct Sci_TextToFind {
Scintilla may ignore this call in some cases. For example, the inline behaviour might only be supported for some languages.</p>
<p>When the inline IME mode is active, characters are added tentatively before being finalised and an
<a class="message" href="#SCN_CHARADDED">SCN_CHARADDED</a>
- notification is sent for each character.</p>
+ notification (with <code class="parameter">characterSource</code> set to <code>SC_CHARACTERSOURCE_TENTATIVE_INPUT</code>) is sent for each character.</p>
<div class="provisional">
<a href="#ProvisionalMessages">These bidirectional features are experimental and incomplete.</a><br />
@@ -7276,7 +7276,7 @@ struct SCNotification {
int updated; /* SCN_UPDATEUI */
int listCompletionMethod;
/* SCN_AUTOCSELECTION, SCN_AUTOCCOMPLETED, SCN_USERLISTSELECTION */
-
+ int characterSource; /* SCN_CHARADDED */
};
</pre>
@@ -7378,6 +7378,44 @@ href="#SCI_POSITIONFROMLINE">SCI_POSITIONFROMLINE</a>(lineNumber);
for DBCS, it is (first byte * 256 + second byte) for 2 byte characters and the byte value for 1 byte characters.
This notification is sent before the character has been styled so processing that depends on
styling should instead be performed in the SCN_UPDATEUI notification.</p>
+ <p>The <code>SCNotification::characterSource</code> field is the source of the character.</p>
+
+ <table class="standard" summary="Character Source">
+ <tbody>
+ <tr>
+ <th align="left">Symbol</th>
+ <th>Value</th>
+ <th align="left">Meaning</th>
+ </tr>
+ </tbody>
+ <tbody>
+ <tr>
+ <td><code>SC_CHARACTERSOURCE_DIRECT_INPUT</code></td>
+ <td>0</td>
+ <td>Direct input characters, including characters generated by calling keyboard commands like <a class="seealso" href="#SCI_NEWLINE">SCI_NEWLINE</a>.</td>
+ </tr>
+
+ <tr>
+ <td><code>SC_CHARACTERSOURCE_TENTATIVE_INPUT</code></td>
+ <td>1</td>
+ <td>Tentative input characters. They are used by IME (inline mode, see <a class="seealso" href="#SCI_SETIMEINTERACTION">SCI_SETIMEINTERACTION</a>)
+ to composite final string, normally different from final composited string (which is the string that has been truly added into current document),
+ and may be withdrawn when the user cancels typing (e.g. by pressing Esc key).
+ Some system (at least Cocoa) also use tentative input for non-IME features like using dead key to composite diacritical marks (grave accent, etc.).
+ These characters are not added to macro recording. Most applications can simply ignore the notification when this value is set.
+ </td>
+ </tr>
+
+ <tr>
+ <td><code>SC_CHARACTERSOURCE_IME_RESULT</code></td>
+ <td>2</td>
+ <td>IME (either inline or windowed mode) full composited string. Modern IME is able to composite English word or sentence,
+ when this value is set, current character may not a Chinese, Japanese or Korean character.
+ Currently, this is only set on Windows.</td>
+ </tr>
+
+ </tbody>
+ </table>
<p><b id="SCN_SAVEPOINTREACHED">SCN_SAVEPOINTREACHED</b><br />
<b id="SCN_SAVEPOINTLEFT">SCN_SAVEPOINTLEFT</b><br />
diff --git a/doc/ScintillaHistory.html b/doc/ScintillaHistory.html
index 27afa47b3..118859ac2 100644
--- a/doc/ScintillaHistory.html
+++ b/doc/ScintillaHistory.html
@@ -570,6 +570,11 @@
<a href="https://sourceforge.net/p/scintilla/feature-requests/1297/">Feature #1297</a>.
</li>
<li>
+ Source of input (direct / IME composition / IME result) reported in SCN_CHARADDED so applications
+ can treat temporary IME composition input differently.
+ <a href="https://sourceforge.net/p/scintilla/bugs/2038/">Bug #2038</a>.
+ </li>
+ <li>
Lexer added for DataFlex.
<a href="https://sourceforge.net/p/scintilla/feature-requests/1295/">Feature #1295</a>.
</li>
diff --git a/gtk/ScintillaGTK.cxx b/gtk/ScintillaGTK.cxx
index 3b1972880..5da17aacf 100644
--- a/gtk/ScintillaGTK.cxx
+++ b/gtk/ScintillaGTK.cxx
@@ -2351,7 +2351,7 @@ void ScintillaGTK::CommitThis(char *commitStr) {
if (!IsUnicodeMode())
docChar = ConvertText(u8Char, u8CharLen, charSetSource, "UTF-8", true);
- InsertCharacter(docChar);
+ InsertCharacter(docChar, CharacterSource::directInput);
}
g_free(uniStr);
ShowCaretAtCurrentPosition();
@@ -2403,8 +2403,6 @@ void ScintillaGTK::PreeditChangedInlineThis() {
std::vector<int> indicator = MapImeIndicators(preeditStr.attrs, preeditStr.str);
- const bool tmpRecordingMacro = recordingMacro;
- recordingMacro = false;
for (glong i = 0; i < preeditStr.uniStrLen; i++) {
gchar u8Char[UTF8MaxBytes+2] = {0};
const gint u8CharLen = g_unichar_to_utf8(preeditStr.uniStr[i], u8Char);
@@ -2412,11 +2410,10 @@ void ScintillaGTK::PreeditChangedInlineThis() {
if (!IsUnicodeMode())
docChar = ConvertText(u8Char, u8CharLen, charSetSource, "UTF-8", true);
- InsertCharacter(docChar);
+ InsertCharacter(docChar, CharacterSource::tentativeInput);
DrawImeIndicator(indicator[i], docChar.size());
}
- recordingMacro = tmpRecordingMacro;
// Move caret to ime cursor position.
const int imeEndToImeCaretU32 = preeditStr.cursor_pos - preeditStr.uniStrLen;
diff --git a/include/Scintilla.h b/include/Scintilla.h
index c7db899d7..808ad9985 100644
--- a/include/Scintilla.h
+++ b/include/Scintilla.h
@@ -1091,6 +1091,9 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam,
#define SC_AC_TAB 3
#define SC_AC_NEWLINE 4
#define SC_AC_COMMAND 5
+#define SC_CHARACTERSOURCE_DIRECT_INPUT 0
+#define SC_CHARACTERSOURCE_TENTATIVE_INPUT 1
+#define SC_CHARACTERSOURCE_IME_RESULT 2
#define SCN_STYLENEEDED 2000
#define SCN_CHARADDED 2001
#define SCN_SAVEPOINTREACHED 2002
@@ -1233,6 +1236,7 @@ struct SCNotification {
int updated; /* SCN_UPDATEUI */
int listCompletionMethod;
/* SCN_AUTOCSELECTION, SCN_AUTOCCOMPLETED, SCN_USERLISTSELECTION, */
+ int characterSource; /* SCN_CHARADDED */
};
#ifdef INCLUDE_DEPRECATED_FEATURES
diff --git a/include/Scintilla.iface b/include/Scintilla.iface
index 661a6a12b..8107ae47c 100644
--- a/include/Scintilla.iface
+++ b/include/Scintilla.iface
@@ -3017,6 +3017,15 @@ val SC_AC_COMMAND=5
ali SC_AC_FILLUP=FILL_UP
ali SC_AC_DOUBLECLICK=DOUBLE_CLICK
+# characterSource for SCN_CHARADDED
+enu CharacterSource=SC_CHARACTERSOURCE_
+# Direct input characters.
+val SC_CHARACTERSOURCE_DIRECT_INPUT=0
+# IME (inline mode) or dead key tentative input characters.
+val SC_CHARACTERSOURCE_TENTATIVE_INPUT=1
+# IME (either inline or windowed mode) full composited string.
+val SC_CHARACTERSOURCE_IME_RESULT=2
+
################################################
# For SciLexer.h
enu Lexer=SCLEX_
@@ -5165,7 +5174,7 @@ val SCE_DF_ICODE=14
# Events
evt void StyleNeeded=2000(int position)
-evt void CharAdded=2001(int ch)
+evt void CharAdded=2001(int ch, int characterSource)
evt void SavePointReached=2002(void)
evt void SavePointLeft=2003(void)
evt void ModifyAttemptRO=2004(void)
diff --git a/qt/ScintillaEditBase/ScintillaEditBase.cpp b/qt/ScintillaEditBase/ScintillaEditBase.cpp
index 261dfa520..d822c84d4 100644
--- a/qt/ScintillaEditBase/ScintillaEditBase.cpp
+++ b/qt/ScintillaEditBase/ScintillaEditBase.cpp
@@ -258,7 +258,7 @@ void ScintillaEditBase::keyPressEvent(QKeyEvent *event)
QString text = event->text();
if (input && !text.isEmpty() && text[0].isPrint()) {
QByteArray utext = sqt->BytesForDocument(text);
- sqt->InsertCharacter(std::string_view(utext.data(), utext.size()));
+ sqt->InsertCharacter(std::string_view(utext.data(), utext.size()), EditModel::CharacterSource::directInput);
} else {
event->ignore();
}
@@ -548,7 +548,7 @@ void ScintillaEditBase::inputMethodEvent(QInputMethodEvent *event)
const QString oneCharUTF16 = commitStr.mid(i, ucWidth);
const QByteArray oneChar = sqt->BytesForDocument(oneCharUTF16);
- sqt->InsertCharacter(std::string_view(oneChar.data(), oneChar.length()));
+ sqt->InsertCharacter(std::string_view(oneChar.data(), oneChar.length()), EditModel::CharacterSource::directInput);
i += ucWidth;
}
@@ -566,20 +566,17 @@ void ScintillaEditBase::inputMethodEvent(QInputMethodEvent *event)
std::vector<int> imeIndicator = MapImeIndicators(event);
- const bool recording = sqt->recordingMacro;
- sqt->recordingMacro = false;
for (unsigned int i = 0; i < preeditStrLen;) {
const unsigned int ucWidth = preeditStr.at(i).isHighSurrogate() ? 2 : 1;
const QString oneCharUTF16 = preeditStr.mid(i, ucWidth);
const QByteArray oneChar = sqt->BytesForDocument(oneCharUTF16);
const int oneCharLen = oneChar.length();
- sqt->InsertCharacter(std::string_view(oneChar.data(), oneCharLen));
+ sqt->InsertCharacter(std::string_view(oneChar.data(), oneCharLen), EditModel::CharacterSource::tentativeInput);
DrawImeIndicator(imeIndicator[i], oneCharLen);
i += ucWidth;
}
- sqt->recordingMacro = recording;
// Move IME carets.
int imeCaretPos = GetImeCaretPos(event);
diff --git a/src/EditModel.h b/src/EditModel.h
index b63f2129f..9e2f6d94d 100644
--- a/src/EditModel.h
+++ b/src/EditModel.h
@@ -37,7 +37,7 @@ public:
bool primarySelection;
enum IMEInteraction { imeWindowed, imeInline } imeInteraction;
-
+ enum class CharacterSource { directInput, tentativeInput, imeResult };
enum class Bidirectional { bidiDisabled, bidiL2R, bidiR2L } bidirectional;
int foldFlags;
diff --git a/src/Editor.cxx b/src/Editor.cxx
index 92c77571e..2cf12f61f 100644
--- a/src/Editor.cxx
+++ b/src/Editor.cxx
@@ -1891,7 +1891,7 @@ void Editor::AddChar(char ch) {
char s[2];
s[0] = ch;
s[1] = '\0';
- InsertCharacter(std::string_view(s, 1));
+ InsertCharacter(std::string_view(s, 1), CharacterSource::directInput);
}
void Editor::FilterSelections() {
@@ -1902,7 +1902,7 @@ void Editor::FilterSelections() {
}
// InsertCharacter inserts a character encoded in document code page.
-void Editor::InsertCharacter(std::string_view sv) {
+void Editor::InsertCharacter(std::string_view sv, CharacterSource charSource) {
if (sv.empty()) {
return;
}
@@ -1994,9 +1994,9 @@ void Editor::InsertCharacter(std::string_view sv) {
ch = utf32[0];
}
}
- NotifyChar(ch);
+ NotifyChar(ch, charSource);
- if (recordingMacro) {
+ if (recordingMacro && charSource != CharacterSource::tentativeInput) {
std::string copy(sv); // ensure NUL-terminated
NotifyMacroRecord(SCI_REPLACESEL, 0, reinterpret_cast<sptr_t>(copy.data()));
}
@@ -2342,10 +2342,11 @@ void Editor::NotifyErrorOccurred(Document *, void *, int status) {
errorStatus = status;
}
-void Editor::NotifyChar(int ch) {
+void Editor::NotifyChar(int ch, CharacterSource charSource) {
SCNotification scn = {};
scn.nmhdr.code = SCN_CHARADDED;
scn.ch = ch;
+ scn.characterSource = static_cast<int>(charSource);
NotifyParent(scn);
}
@@ -3091,7 +3092,7 @@ void Editor::NewLine() {
for (size_t i = 0; i < countInsertions; i++) {
const char *eol = StringFromEOLMode(pdoc->eolMode);
while (*eol) {
- NotifyChar(*eol);
+ NotifyChar(*eol, CharacterSource::directInput);
if (recordingMacro) {
char txt[2];
txt[0] = *eol;
diff --git a/src/Editor.h b/src/Editor.h
index 5716ba048..f16a46693 100644
--- a/src/Editor.h
+++ b/src/Editor.h
@@ -393,7 +393,7 @@ protected: // ScintillaBase subclass needs access to much of Editor
Sci::Position RealizeVirtualSpace(Sci::Position position, Sci::Position virtualSpace);
SelectionPosition RealizeVirtualSpace(const SelectionPosition &position);
void AddChar(char ch);
- virtual void InsertCharacter(std::string_view sv);
+ virtual void InsertCharacter(std::string_view sv, CharacterSource charSource);
void ClearBeforeTentativeStart();
void InsertPaste(const char *text, Sci::Position len);
enum PasteShape { pasteStream=0, pasteRectangular = 1, pasteLine = 2 };
@@ -421,7 +421,7 @@ protected: // ScintillaBase subclass needs access to much of Editor
virtual int GetCtrlID() { return ctrlID; }
virtual void NotifyParent(SCNotification scn) = 0;
virtual void NotifyStyleToNeeded(Sci::Position endStyleNeeded);
- void NotifyChar(int ch);
+ void NotifyChar(int ch, CharacterSource charSource);
void NotifySavePoint(bool isSavePoint);
void NotifyModifyAttempt();
virtual void NotifyDoubleClick(Point pt, int modifiers);
diff --git a/src/ScintillaBase.cxx b/src/ScintillaBase.cxx
index 6799dfd06..296f5f8e6 100644
--- a/src/ScintillaBase.cxx
+++ b/src/ScintillaBase.cxx
@@ -80,20 +80,20 @@ void ScintillaBase::Finalise() {
}
void ScintillaBase::AddCharUTF(const char *s, unsigned int len, bool /*treatAsDBCS*/) {
- InsertCharacter(std::string_view(s, len));
+ InsertCharacter(std::string_view(s, len), CharacterSource::directInput);
}
-void ScintillaBase::InsertCharacter(std::string_view sv) {
+void ScintillaBase::InsertCharacter(std::string_view sv, CharacterSource charSource) {
const bool isFillUp = ac.Active() && ac.IsFillUpChar(sv[0]);
if (!isFillUp) {
- Editor::InsertCharacter(sv);
+ Editor::InsertCharacter(sv, charSource);
}
if (ac.Active()) {
AutoCompleteCharacterAdded(sv[0]);
// For fill ups add the character after the autocompletion has
// triggered so containers see the key so can display a calltip.
if (isFillUp) {
- Editor::InsertCharacter(sv);
+ Editor::InsertCharacter(sv, charSource);
}
}
}
diff --git a/src/ScintillaBase.h b/src/ScintillaBase.h
index d28e47c4e..fc4315e6d 100644
--- a/src/ScintillaBase.h
+++ b/src/ScintillaBase.h
@@ -63,7 +63,7 @@ protected:
// This method is deprecated, use InsertCharacter instead. The treatAsDBCS parameter is no longer used.
virtual void AddCharUTF(const char *s, unsigned int len, bool treatAsDBCS=false);
- void InsertCharacter(std::string_view sv) override;
+ void InsertCharacter(std::string_view sv, CharacterSource charSource) override;
void Command(int cmdId);
void CancelModes() override;
int KeyCommand(unsigned int iMessage) override;
diff --git a/win32/ScintillaWin.cxx b/win32/ScintillaWin.cxx
index 0f79fccb5..ec9cb5498 100644
--- a/win32/ScintillaWin.cxx
+++ b/win32/ScintillaWin.cxx
@@ -340,7 +340,7 @@ class ScintillaWin :
void SelectionToHangul();
void EscapeHanja();
void ToggleHanja();
- void AddWString(std::wstring_view wsv);
+ void AddWString(std::wstring_view wsv, CharacterSource charSource);
UINT CodePageOfDocument() const;
bool ValidCodePage(int codePage) const override;
@@ -893,7 +893,7 @@ sptr_t ScintillaWin::HandleCompositionWindowed(uptr_t wParam, sptr_t lParam) {
if (lParam & GCS_RESULTSTR) {
IMContext imc(MainHWND());
if (imc.hIMC) {
- AddWString(imc.GetCompositionString(GCS_RESULTSTR));
+ AddWString(imc.GetCompositionString(GCS_RESULTSTR), CharacterSource::imeResult);
// Set new position after converted
const Point pos = PointMainCaret();
@@ -1046,7 +1046,7 @@ std::vector<int> MapImeIndicators(std::vector<BYTE> inputStyle) {
}
-void ScintillaWin::AddWString(std::wstring_view wsv) {
+void ScintillaWin::AddWString(std::wstring_view wsv, CharacterSource charSource) {
if (wsv.empty())
return;
@@ -1055,7 +1055,7 @@ void ScintillaWin::AddWString(std::wstring_view wsv) {
const size_t ucWidth = UTF16CharLength(wsv[i]);
const std::string docChar = StringEncode(wsv.substr(i, ucWidth), codePage);
- InsertCharacter(docChar);
+ InsertCharacter(docChar, charSource);
i += ucWidth;
}
}
@@ -1096,20 +1096,17 @@ sptr_t ScintillaWin::HandleCompositionInline(uptr_t, sptr_t lParam) {
std::vector<int> imeIndicator = MapImeIndicators(imc.GetImeAttributes());
- const bool tmpRecordingMacro = recordingMacro;
- recordingMacro = false;
const int codePage = CodePageOfDocument();
const std::wstring_view wsv = wcs;
for (size_t i = 0; i < wsv.size(); ) {
const size_t ucWidth = UTF16CharLength(wsv[i]);
const std::string docChar = StringEncode(wsv.substr(i, ucWidth), codePage);
- InsertCharacter(docChar);
+ InsertCharacter(docChar, CharacterSource::tentativeInput);
DrawImeIndicator(imeIndicator[i], static_cast<unsigned int>(docChar.size()));
i += ucWidth;
}
- recordingMacro = tmpRecordingMacro;
// Move IME caret from current last position to imeCaretPos.
const int imeEndToImeCaretU16 = imc.GetImeCaretPos() - static_cast<unsigned int>(wcs.size());
@@ -1121,7 +1118,7 @@ sptr_t ScintillaWin::HandleCompositionInline(uptr_t, sptr_t lParam) {
view.imeCaretBlockOverride = true;
}
} else if (lParam & GCS_RESULTSTR) {
- AddWString(imc.GetCompositionString(GCS_RESULTSTR));
+ AddWString(imc.GetCompositionString(GCS_RESULTSTR), CharacterSource::imeResult);
}
EnsureCaretVisible();
SetCandidateWindowPos();
@@ -1479,7 +1476,7 @@ sptr_t ScintillaWin::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam
lastHighSurrogateChar = 0;
wclen = 2;
}
- AddWString(std::wstring_view(wcs, wclen));
+ AddWString(std::wstring_view(wcs, wclen), CharacterSource::directInput);
}
return 0;
@@ -1491,7 +1488,7 @@ sptr_t ScintillaWin::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam
} else {
wchar_t wcs[3] = {0};
const unsigned int wclen = UTF16FromUTF32Character(static_cast<unsigned int>(wParam), wcs);
- AddWString(std::wstring_view(wcs, wclen));
+ AddWString(std::wstring_view(wcs, wclen), CharacterSource::directInput);
return FALSE;
}