aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/ScintillaBase.cxx
diff options
context:
space:
mode:
authorZufu Liu <unknown>2019-06-17 08:49:43 +1000
committerZufu Liu <unknown>2019-06-17 08:49:43 +1000
commit1e79a7c53fbfd7481e26f92037de92597dedaf79 (patch)
tree7ea049531f97b9bba03c23f28555563480cee58c /src/ScintillaBase.cxx
parenta82f89692231c7bd44b1dab9f4343836bbf1fa54 (diff)
downloadscintilla-mirror-1e79a7c53fbfd7481e26f92037de92597dedaf79.tar.gz
Feature [feature-requests:#1293]. InsertCharacter replaces AddCharUTF.
Diffstat (limited to 'src/ScintillaBase.cxx')
-rw-r--r--src/ScintillaBase.cxx14
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);
}
}
}