aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--doc/ScintillaDoc.html6
-rw-r--r--src/ScintillaBase.cxx9
-rw-r--r--src/ScintillaBase.h1
3 files changed, 14 insertions, 2 deletions
diff --git a/doc/ScintillaDoc.html b/doc/ScintillaDoc.html
index f93aaea89..cc6c8f422 100644
--- a/doc/ScintillaDoc.html
+++ b/doc/ScintillaDoc.html
@@ -2872,6 +2872,7 @@ struct TextToFind {
<a class="message" href="#SCI_AUTOCGETSEPARATOR">SCI_AUTOCGETSEPARATOR</a><br />
<a class="message" href="#SCI_AUTOCSELECT">SCI_AUTOCSELECT(&lt;unused&gt;, const char
*select)</a><br />
+ <a class="message" href="#SCI_AUTOCGETCURRENT">SCI_AUTOCGETCURRENT</a><br />
<a class="message" href="#SCI_AUTOCSETCANCELATSTART">SCI_AUTOCSETCANCELATSTART(bool
cancel)</a><br />
<a class="message" href="#SCI_AUTOCGETCANCELATSTART">SCI_AUTOCGETCANCELATSTART</a><br />
@@ -2937,6 +2938,7 @@ struct TextToFind {
<code>SCI_AUTOCSHOW</code> list. The default is the space character.</p>
<p><b id="SCI_AUTOCSELECT">SCI_AUTOCSELECT(&lt;unused&gt;, const char *select)</b><br />
+ <b id="SCI_AUTOCGETCURRENT">SCI_AUTOCGETCURRENT</b><br />
This message selects an item in the autocompletion list. It searches the list of words for the
first that matches <code>select</code>. By default, comparisons are case sensitive, but you can
change this with <a class="message"
@@ -2945,7 +2947,9 @@ struct TextToFind {
will match "Frederick" if this is the first item in the list that begins with "Fred". If an
item is found, it is selected. If the item is not found, the autocompletion list closes if
auto-hide is true (see <a class="message"
- href="#SCI_AUTOCSETAUTOHIDE"><code>SCI_AUTOCSETAUTOHIDE</code></a>).</p>
+ href="#SCI_AUTOCSETAUTOHIDE"><code>SCI_AUTOCSETAUTOHIDE</code></a>).<br />
+ The current selection can be retrieved with <code>SCI_AUTOCGETCURRENT</code>
+ </p>
<p><b id="SCI_AUTOCSETCANCELATSTART">SCI_AUTOCSETCANCELATSTART(bool cancel)</b><br />
<b id="SCI_AUTOCGETCANCELATSTART">SCI_AUTOCGETCANCELATSTART</b><br />
diff --git a/src/ScintillaBase.cxx b/src/ScintillaBase.cxx
index ed391c846..e42b5dc65 100644
--- a/src/ScintillaBase.cxx
+++ b/src/ScintillaBase.cxx
@@ -347,6 +347,10 @@ void ScintillaBase::AutoCompleteCompleted() {
pdoc->EndUndoAction();
}
+int ScintillaBase::AutoCompleteGetCurrent() {
+ return ac.lb->GetSelection();
+}
+
void ScintillaBase::CallTipShow(Point pt, const char *defn) {
AutoCompleteCancel();
pt.y += vs.lineHeight;
@@ -499,6 +503,9 @@ sptr_t ScintillaBase::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lPara
ac.Select(reinterpret_cast<char *>(lParam));
break;
+ case SCI_AUTOCGETCURRENT:
+ return AutoCompleteGetCurrent();
+
case SCI_AUTOCSETCANCELATSTART:
ac.cancelAtStartPos = wParam != 0;
break;
@@ -559,7 +566,7 @@ sptr_t ScintillaBase::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lPara
return ac.GetTypesep();
case SCI_CALLTIPSHOW:
- CallTipShow(LocationFromPosition(wParam),
+ CallTipShow(LocationFromPosition(wParam),
reinterpret_cast<const char *>(lParam));
break;
diff --git a/src/ScintillaBase.h b/src/ScintillaBase.h
index bb09e3f5b..6ea23ab5a 100644
--- a/src/ScintillaBase.h
+++ b/src/ScintillaBase.h
@@ -65,6 +65,7 @@ protected:
void AutoCompleteStart(int lenEntered, const char *list);
void AutoCompleteCancel();
void AutoCompleteMove(int delta);
+ int AutoCompleteGetCurrent();
void AutoCompleteCharacterAdded(char ch);
void AutoCompleteCharacterDeleted();
void AutoCompleteCompleted();