aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authornyamatongwe <unknown>2002-06-08 05:25:48 +0000
committernyamatongwe <unknown>2002-06-08 05:25:48 +0000
commit08e698f6de9cb1be41f1a61956126eedef41ef7d (patch)
tree2dc416ff3bf3fd70c4b7c3c0ea2f0ff0080b6898 /src
parent2c5b647c3ccfa9a6ba413687006ed46744e8a921 (diff)
downloadscintilla-mirror-08e698f6de9cb1be41f1a61956126eedef41ef7d.tar.gz
Changed autocompletion fill up character handling to ensure the fill up character is added separately and is seen as a char added notification so that calltips can be shown.
Diffstat (limited to 'src')
-rw-r--r--src/ScintillaBase.cxx19
-rw-r--r--src/ScintillaBase.h2
2 files changed, 13 insertions, 8 deletions
diff --git a/src/ScintillaBase.cxx b/src/ScintillaBase.cxx
index 0dabb5393..617cef26f 100644
--- a/src/ScintillaBase.cxx
+++ b/src/ScintillaBase.cxx
@@ -64,11 +64,18 @@ void ScintillaBase::RefreshColourPalette(Palette &pal, bool want) {
}
void ScintillaBase::AddCharUTF(char *s, unsigned int len, bool treatAsDBCS) {
- bool acActiveBeforeCharAdded = ac.Active();
- if (!acActiveBeforeCharAdded || !ac.IsFillUpChar(*s))
+ bool isFillUp = ac.Active() && ac.IsFillUpChar(*s);
+ if (!isFillUp) {
Editor::AddCharUTF(s, len, treatAsDBCS);
- if (acActiveBeforeCharAdded)
+ }
+ if (ac.Active()) {
AutoCompleteChanged(s[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);
+ }
+ }
}
void ScintillaBase::Command(int cmdId) {
@@ -278,7 +285,7 @@ void ScintillaBase::AutoCompleteMoveToCurrentWord() {
void ScintillaBase::AutoCompleteChanged(char ch) {
if (ac.IsFillUpChar(ch)) {
- AutoCompleteCompleted(ch);
+ AutoCompleteCompleted();
} else if (currentPos <= ac.posStart - ac.startLen) {
ac.Cancel();
} else if (ac.cancelAtStartPos && currentPos <= ac.posStart) {
@@ -290,7 +297,7 @@ void ScintillaBase::AutoCompleteChanged(char ch) {
}
}
-void ScintillaBase::AutoCompleteCompleted(char fillUp/*='\0'*/) {
+void ScintillaBase::AutoCompleteCompleted() {
int item = ac.lb.GetSelection();
char selected[1000];
if (item != -1) {
@@ -323,8 +330,6 @@ void ScintillaBase::AutoCompleteCompleted(char fillUp/*='\0'*/) {
SetEmptySelection(ac.posStart);
if (item != -1) {
SString piece = selected;
- if (fillUp)
- piece += fillUp;
pdoc->InsertString(firstPos, piece.c_str());
SetEmptySelection(firstPos + piece.length());
}
diff --git a/src/ScintillaBase.h b/src/ScintillaBase.h
index 7e3887c15..28c089edd 100644
--- a/src/ScintillaBase.h
+++ b/src/ScintillaBase.h
@@ -66,7 +66,7 @@ protected:
void AutoCompleteCancel();
void AutoCompleteMove(int delta);
void AutoCompleteChanged(char ch=0);
- void AutoCompleteCompleted(char fillUp='\0');
+ void AutoCompleteCompleted();
void AutoCompleteMoveToCurrentWord();
static void AutoCompleteDoubleClick(void* p);