[QScintilla] Strange behaviour in Autocompletion
Vincent Renaudineau
vincent.renaudineau at lip6.fr
Fri Dec 17 16:23:32 GMT 2010
Hi !
I have a strange behaviour when using autoCompleteFromAll with my custom
lexer : keywords are displayed twice !
Indeed, they are in my API, and in my document.
So when I want autocomplete "impo" (for "import"), it finds "import" in
the API and in the document.
The problem come from QsciAPIs::updateAutoCompletionList()
qsciapis.cpp, line 445-453
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Get the word we are interested in (ie. the one after the
// current origin in path).
QString w = base.mid(origin_len + wsep.length()).split(wsep).first();
// Append the space, we know the origin is unambiguous.
w.append(' ');
if (!list.contains(w))
list << w;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
It appends a whitespace so "import " is different of "import" when it
searches if "import" is not already in wlist in
QsciScintilla::startAutoCompletion().
I propose to remove the whitespace at a time, or had a whitespace for
the comparison.
Thanks
--
Vincent Renaudineau <vincent.renaudineau at lip6.fr>
Lip6 (France)
More information about the QScintilla
mailing list