]> git.saurik.com Git - wxWidgets.git/blobdiff - src/stc/scintilla/src/ScintillaBase.cxx
more reformatting
[wxWidgets.git] / src / stc / scintilla / src / ScintillaBase.cxx
index e42b5dc65ea0b0e065295df708d615e6a3e0729b..1d3867b7fe1510660dbfd4fa9a985f7ffc0202fa 100644 (file)
@@ -280,9 +280,9 @@ void ScintillaBase::AutoCompleteMoveToCurrentWord() {
        char wordCurrent[1000];
        int i;
        int startWord = ac.posStart - ac.startLen;
-       for (i = startWord; i < currentPos; i++)
+       for (i = startWord; i < currentPos && i - startWord < 1000; i++)
                wordCurrent[i - startWord] = pdoc->CharAt(i);
-       wordCurrent[i - startWord] = '\0';
+       wordCurrent[Platform::Minimum(i - startWord, 999)] = '\0';
        ac.Select(wordCurrent);
 }
 
@@ -297,7 +297,7 @@ void ScintillaBase::AutoCompleteCharacterAdded(char ch) {
 }
 
 void ScintillaBase::AutoCompleteCharacterDeleted() {
-       if (currentPos <= ac.posStart - ac.startLen) {
+       if (currentPos < ac.posStart - ac.startLen) {
                ac.Cancel();
        } else if (ac.cancelAtStartPos && (currentPos <= ac.posStart)) {
                ac.Cancel();
@@ -314,6 +314,8 @@ void ScintillaBase::AutoCompleteCompleted() {
                ac.lb->GetValue(item, selected, sizeof(selected));
        }
        ac.Cancel();
+       if (item == -1)
+               return;
 
        if (listType > 0) {
                userListSelected = selected;
@@ -355,11 +357,12 @@ void ScintillaBase::CallTipShow(Point pt, const char *defn) {
        AutoCompleteCancel();
        pt.y += vs.lineHeight;
        PRectangle rc = ct.CallTipStart(currentPos, pt,
-                                                                       defn,
-                                                                       vs.styles[STYLE_DEFAULT].fontName,
-                                                                       vs.styles[STYLE_DEFAULT].sizeZoomed,
-                                                                       IsUnicodeMode(),
-                                                                       wMain);
+               defn,
+               vs.styles[STYLE_DEFAULT].fontName,
+               vs.styles[STYLE_DEFAULT].sizeZoomed,
+               CodePage(),
+               vs.styles[STYLE_DEFAULT].characterSet,
+               wMain);
        // If the call-tip window would be out of the client
        // space, adjust so it displays above the text.
        PRectangle rcClient = GetClientRectangle();