aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/ScintillaBase.cxx
diff options
context:
space:
mode:
authornyamatongwe <unknown>2005-03-09 03:34:46 +0000
committernyamatongwe <unknown>2005-03-09 03:34:46 +0000
commitafc7afe13b6eb49984e1c9c66eef3cebc1392a09 (patch)
tree526577481daf6dbee2aeb0142d9baa8c3b97e117 /src/ScintillaBase.cxx
parentb64920976eb1ddc19630f435c2aee7788b6b6815 (diff)
downloadscintilla-mirror-afc7afe13b6eb49984e1c9c66eef3cebc1392a09.tar.gz
Patch from Blair McGlashan to send a notification before accepting an autocompletion.
Diffstat (limited to 'src/ScintillaBase.cxx')
-rw-r--r--src/ScintillaBase.cxx36
1 files changed, 21 insertions, 15 deletions
diff --git a/src/ScintillaBase.cxx b/src/ScintillaBase.cxx
index 78c15f7d7..7735d35db 100644
--- a/src/ScintillaBase.cxx
+++ b/src/ScintillaBase.cxx
@@ -262,7 +262,7 @@ void ScintillaBase::AutoCompleteStart(int lenEntered, const char *list) {
}
rcList.bottom = rcList.top + heightAlloced;
ac.lb->SetPositionRelative(rcList, wMain);
- ac.Show();
+ ac.Show(true);
if (lenEntered != 0) {
AutoCompleteMoveToCurrentWord();
}
@@ -312,25 +312,31 @@ void ScintillaBase::AutoCompleteCompleted() {
selected[0] = '\0';
if (item != -1) {
ac.lb->GetValue(item, selected, sizeof(selected));
+ } else {
+ ac.Cancel();
+ return;
}
- ac.Cancel();
- if (item == -1)
+
+ ac.Show(false);
+
+ listSelected = selected;
+ SCNotification scn;
+ scn.nmhdr.code = listType > 0 ? SCN_USERLISTSELECTION : SCN_AUTOCSELECTION;
+ scn.message = 0;
+ scn.wParam = listType;
+ scn.listType = listType;
+ Position firstPos = ac.posStart - ac.startLen;
+ scn.lParam = firstPos;
+ scn.text = listSelected.c_str();
+ NotifyParent(scn);
+
+ if (!ac.Active())
return;
+ ac.Cancel();
- if (listType > 0) {
- userListSelected = selected;
- SCNotification scn;
- scn.nmhdr.code = SCN_USERLISTSELECTION;
- scn.message = 0;
- scn.wParam = listType;
- scn.listType = listType;
- scn.lParam = 0;
- scn.text = userListSelected.c_str();
- NotifyParent(scn);
+ if (listType > 0)
return;
- }
- Position firstPos = ac.posStart - ac.startLen;
Position endPos = currentPos;
if (ac.dropRestOfWord)
endPos = pdoc->ExtendWordSelect(endPos, 1, true);