diff options
author | Zufu Liu <unknown> | 2019-06-17 08:49:43 +1000 |
---|---|---|
committer | Zufu Liu <unknown> | 2019-06-17 08:49:43 +1000 |
commit | 1e79a7c53fbfd7481e26f92037de92597dedaf79 (patch) | |
tree | 7ea049531f97b9bba03c23f28555563480cee58c /src/ScintillaBase.cxx | |
parent | a82f89692231c7bd44b1dab9f4343836bbf1fa54 (diff) | |
download | scintilla-mirror-1e79a7c53fbfd7481e26f92037de92597dedaf79.tar.gz |
Feature [feature-requests:#1293]. InsertCharacter replaces AddCharUTF.
Diffstat (limited to 'src/ScintillaBase.cxx')
-rw-r--r-- | src/ScintillaBase.cxx | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/ScintillaBase.cxx b/src/ScintillaBase.cxx index 5a44fd9af..6799dfd06 100644 --- a/src/ScintillaBase.cxx +++ b/src/ScintillaBase.cxx @@ -79,17 +79,21 @@ void ScintillaBase::Finalise() { popup.Destroy(); } -void ScintillaBase::AddCharUTF(const char *s, unsigned int len, bool treatAsDBCS) { - const bool isFillUp = ac.Active() && ac.IsFillUpChar(*s); +void ScintillaBase::AddCharUTF(const char *s, unsigned int len, bool /*treatAsDBCS*/) { + InsertCharacter(std::string_view(s, len)); +} + +void ScintillaBase::InsertCharacter(std::string_view sv) { + const bool isFillUp = ac.Active() && ac.IsFillUpChar(sv[0]); if (!isFillUp) { - Editor::AddCharUTF(s, len, treatAsDBCS); + Editor::InsertCharacter(sv); } if (ac.Active()) { - AutoCompleteCharacterAdded(s[0]); + 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::AddCharUTF(s, len, treatAsDBCS); + Editor::InsertCharacter(sv); } } } |