aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authornyamatongwe <unknown>2003-10-01 11:30:16 +0000
committernyamatongwe <unknown>2003-10-01 11:30:16 +0000
commit46e5bc7b4a5a7176701c84d44687254a70395d67 (patch)
tree0d3b9159780889bd96169650c82f755916ecf4ac
parent3d3795bb0e3a9a7de8113a0354396f7b944730c4 (diff)
downloadscintilla-mirror-46e5bc7b4a5a7176701c84d44687254a70395d67.tar.gz
Remove image index for choose single.
-rw-r--r--src/ScintillaBase.cxx10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/ScintillaBase.cxx b/src/ScintillaBase.cxx
index 039539ad3..ed391c846 100644
--- a/src/ScintillaBase.cxx
+++ b/src/ScintillaBase.cxx
@@ -198,16 +198,18 @@ void ScintillaBase::AutoCompleteStart(int lenEntered, const char *list) {
if (ac.chooseSingle && (listType == 0)) {
if (list && !strchr(list, ac.GetSeparator())) {
+ const char *typeSep = strchr(list, ac.GetTypesep());
+ size_t lenInsert = (typeSep) ? (typeSep-list) : strlen(list);
if (ac.ignoreCase) {
SetEmptySelection(currentPos - lenEntered);
pdoc->DeleteChars(currentPos, lenEntered);
SetEmptySelection(currentPos);
- pdoc->InsertString(currentPos, list);
- SetEmptySelection(currentPos + static_cast<int>(strlen(list)));
+ pdoc->InsertString(currentPos, list, lenInsert);
+ SetEmptySelection(currentPos + lenInsert);
} else {
SetEmptySelection(currentPos);
- pdoc->InsertString(currentPos, list + lenEntered);
- SetEmptySelection(currentPos + static_cast<int>(strlen(list + lenEntered)));
+ pdoc->InsertString(currentPos, list + lenEntered, lenInsert - lenEntered);
+ SetEmptySelection(currentPos + lenInsert - lenEntered);
}
return;
}