From 2a15b94200abe8ee0df2dddc296f3dafd55655f8 Mon Sep 17 00:00:00 2001 From: mitchell Date: Thu, 11 Jul 2019 14:12:28 -0400 Subject: 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. --- curses/ScintillaCurses.cxx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'curses') diff --git a/curses/ScintillaCurses.cxx b/curses/ScintillaCurses.cxx index 4941ba344..3325d881b 100644 --- a/curses/ScintillaCurses.cxx +++ b/curses/ScintillaCurses.cxx @@ -1069,8 +1069,13 @@ public: char utf8[6]; int len; toutf8(key, utf8, &len); - return (InsertCharacter(utf8, len), 1); - } else return (AddChar(key), 1); + InsertCharacter(utf8, len, EditModel::CharacterSource::directInput); + return 1; + } else { + char ch = static_cast(key); + InsertCharacter(&ch, 1, EditModel::CharacterSource::directInput); + return 1; + } } else { SCNotification scn = {}; scn.nmhdr.code = SCN_KEY; -- cgit v1.2.3