aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--doc/ScintillaDoc.html5
-rw-r--r--include/Scintilla.h1
-rw-r--r--include/Scintilla.iface1
-rw-r--r--src/ScintillaBase.cxx21
4 files changed, 21 insertions, 7 deletions
diff --git a/doc/ScintillaDoc.html b/doc/ScintillaDoc.html
index 0ed4ffa8a..9bc173fec 100644
--- a/doc/ScintillaDoc.html
+++ b/doc/ScintillaDoc.html
@@ -4808,6 +4808,7 @@ struct SCNotification {
<a class="message" href="#SCN_INDICATORRELEASE">SCN_INDICATORRELEASE</a><br />
<a class="message" href="#SCN_CALLTIPCLICK">SCN_CALLTIPCLICK</a><br />
<a class="message" href="#SCN_AUTOCSELECTION">SCN_AUTOCSELECTION</a><br />
+ <a class="message" href="#SCN_AUTOCCANCELLED">SCN_AUTOCCANCELLED</a><br />
</code>
<p>The following <code>SCI_*</code> messages are associated with these notifications:</p>
@@ -5443,6 +5444,10 @@ for line = lineStart to lineEnd do SCI_ENSUREVISIBLE(line) next
</tbody>
</table>
+ <p><b id="SCN_AUTOCCANCELLED">SCN_AUTOCCANCELLED</b><br />
+ The user has cancelled an <a class="jump" href="#Autocompletion">autocompletion list</a>.
+ There is no other information in SCNotification.
+
<h2 id="GTK">GTK+</h2>
<p>On GTK+, the following functions create a Scintilla widget, communicate with it and allow
resources to be released after all Scintilla widgets hace been destroyed.</p>
diff --git a/include/Scintilla.h b/include/Scintilla.h
index 90e7669ed..b1e6e3504 100644
--- a/include/Scintilla.h
+++ b/include/Scintilla.h
@@ -751,6 +751,7 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam,
#define SCN_AUTOCSELECTION 2022
#define SCN_INDICATORCLICK 2023
#define SCN_INDICATORRELEASE 2024
+#define SCN_AUTOCCANCELLED 2025
//--Autogenerated -- end of section automatically generated from Scintilla.iface
// These structures are defined to be exactly the same shape as the Win32
diff --git a/include/Scintilla.iface b/include/Scintilla.iface
index edecbec51..32a257345 100644
--- a/include/Scintilla.iface
+++ b/include/Scintilla.iface
@@ -3326,6 +3326,7 @@ evt void CallTipClick=2021(int position)
evt void AutoCSelection=2022(string text)
evt void IndicatorClick=2023(int modifiers, int position)
evt void IndicatorRelease=2024(int modifiers, int position)
+evt void AutoCCancelled=2025(void)
cat Deprecated
diff --git a/src/ScintillaBase.cxx b/src/ScintillaBase.cxx
index 679cc1d1f..d1d9ad4cb 100644
--- a/src/ScintillaBase.cxx
+++ b/src/ScintillaBase.cxx
@@ -173,7 +173,7 @@ int ScintillaBase::KeyCommand(unsigned int iMessage) {
return 0;
default:
- ac.Cancel();
+ AutoCompleteCancel();
}
}
@@ -287,6 +287,13 @@ void ScintillaBase::AutoCompleteStart(int lenEntered, const char *list) {
}
void ScintillaBase::AutoCompleteCancel() {
+ if (ac.Active()) {
+ SCNotification scn = {0};
+ scn.nmhdr.code = SCN_AUTOCCANCELLED;
+ scn.wParam = 0;
+ scn.listType = 0;
+ NotifyParent(scn);
+ }
ac.Cancel();
}
@@ -308,7 +315,7 @@ void ScintillaBase::AutoCompleteCharacterAdded(char ch) {
if (ac.IsFillUpChar(ch)) {
AutoCompleteCompleted();
} else if (ac.IsStopChar(ch)) {
- ac.Cancel();
+ AutoCompleteCancel();
} else {
AutoCompleteMoveToCurrentWord();
}
@@ -316,9 +323,9 @@ void ScintillaBase::AutoCompleteCharacterAdded(char ch) {
void ScintillaBase::AutoCompleteCharacterDeleted() {
if (currentPos < ac.posStart - ac.startLen) {
- ac.Cancel();
+ AutoCompleteCancel();
} else if (ac.cancelAtStartPos && (currentPos <= ac.posStart)) {
- ac.Cancel();
+ AutoCompleteCancel();
} else {
AutoCompleteMoveToCurrentWord();
}
@@ -331,7 +338,7 @@ void ScintillaBase::AutoCompleteCompleted() {
if (item != -1) {
ac.lb->GetValue(item, selected, sizeof(selected));
} else {
- ac.Cancel();
+ AutoCompleteCancel();
return;
}
@@ -378,7 +385,7 @@ int ScintillaBase::AutoCompleteGetCurrent() {
}
void ScintillaBase::CallTipShow(Point pt, const char *defn) {
- AutoCompleteCancel();
+ ac.Cancel();
pt.y += vs.lineHeight;
// If container knows about STYLE_CALLTIP then use it in place of the
// STYLE_DEFAULT for the face name, size and character set. Also use it
@@ -518,7 +525,7 @@ sptr_t ScintillaBase::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lPara
break;
case SCI_AUTOCCANCEL:
- AutoCompleteCancel();
+ ac.Cancel();
break;
case SCI_AUTOCACTIVE: