I am using the ScintillaNET in WPF/C# via the WindowsFormsHost. However, it seems that the control is having an auto-completion problem. I am using a List<string> to hold text to show in the auto-complete drop-down. The variable lang is my List<string> and editor is my ScintillaNET editor:
lang.Add("fprintf");
lang.Add("fscanf");
lang.Add("printf");
lang.Add("scanf");
lang.Add("snprintf");
lang.Add("remove");
lang.Add("rename");
lang.Add("tmpfile");
lang.Add("tmpnam");
lang.Add("fclose");
lang.Add("fflush");
lang.Add("fopen");
lang.Add("freopen");
lang.Add("setbuf");
lang.Add("setvbuf");
editor.AutoComplete.List = lang;
If I typed printf for example, the drop-down goes to the word printf. However, if I select a word added later in the list, like fopen, the same effect (as with printf) does not happen. The drop-down acts as though the word was not there.
But, the word has been correctly added to the drop-down (as when I scroll down the list), I see fopen there.
Why is the auto-complete box not going to fopen when I typed it, but it goes printf when I typed printf and how can I solve this?
Scintilla likes the list in sorted order. Try doing a
That should do the trick for you.
The underlying Scintilla editor has an Autosort feature, but this is not exposed to the .NET version as far as I can see.