Autocomplete Displays Empty List

Topics: Developer Forum, User Forum
Sep 30, 2011 at 5:08 PM

i have a triggerchar set to "c", if "c" is part of a word i get a blank listbox, i would rather it not display it, if the preceding letters don't contain text


if I type <c i get the the desired result of a list with words starting with c.

if i type <mic i then get an empty list, can the list be surpressed at this point?

Thanks in advance for any help,


Oct 3, 2011 at 5:52 PM

To answer my own question. I added the following line (BOLDED) to the show event.

internal void Show(int lengthEntered, SkipList list, bool dontSplit)
            //    We may have the auto-detect of lengthEntered. In which case
            //    look for the last word character as the start
            int le = lengthEntered;
            if (le < 0)
                le = getLengthEntered();

            // We need to make sure we aren't affecting the main list later on.
            // and so we create a new SkipList from the one we're given.
            SkipList usableList = new SkipList(list.GetList());
            StringBuilder strb = new StringBuilder();
            int cop = 1;
            while(le > (cop - 1))
                strb.Append(NativeScintilla.GetCharAt(NativeScintilla.GetCurrentPos() - cop));
            SkipList srList = usableList.RemoveNonMatchingStartString(strb.ToString());
            String rList = getListString(srList);

            if (rList == "") { return; }

            NativeScintilla.AutoCShow(le, rList);

            //    Now it may have been that the auto-detect lengthEntered
            //    caused to AutoCShow call to fail becuase no words matched
            //    the letters we autodetected. In this case just show the
            //    list with a 0 lengthEntered to make sure it will show
            if (!IsActive && lengthEntered < 0)
                NativeScintilla.AutoCShow(0, rList);