about the automatic completion problem

62 views
Skip to first unread message

9702...@qq.com

unread,
Nov 17, 2016, 10:36:00 PM11/17/16
to scintilla-interest
I use this way to complete the automatic keyword:
QsciAPIs *apis = new QsciAPIs(textLexer); apis->add(QString("move")); apis->add(QString("moive"));

question:
apis->add(QString("MoveJ Point"));
in this way, it can automatic keyword "MoveJ";  
My goal is, when I press entry, can auto complete all the word in the text. such as "MoveJ Point"
How do I achieve this function. thx

Neil Hodgson

unread,
Nov 18, 2016, 3:50:49 PM11/18/16
to scintilla...@googlegroups.com
9702...@qq.com:

> I use this way to complete the automatic keyword:
> QsciAPIs *apis = new

This isn’t part of the standard Scintilla API and may be part of QScintilla2.

> apis->add(QString("MoveJ Point"));
> in this way, it can automatic keyword "MoveJ";
> My goal is, when I press entry, can auto complete all the word in the text. such as "MoveJ Point”

To allow spaces in autocompletion lists with the standard API change the separation character from space to something like new line with
http://www.scintilla.org/ScintillaDoc.html#SCI_AUTOCSETSEPARATOR

Neil

9702...@qq.com

unread,
Nov 21, 2016, 9:26:48 PM11/21/16
to scintilla-interest, nyama...@me.com


  To allow spaces in autocompletion lists with the standard API change the separation character from space to something like new line with
http://www.scintilla.org/ScintillaDoc.html#SCI_AUTOCSETSEPARATOR


Thank you for your answers. But I still haven't solved my problem.  I used the way you said
it can display more than one word in the list.



But I select the second row of the list and press enter, Only one word is displayed in the text------ "JUMP"..  And not showing all the words "JUMP KA KKUKD"



Neil Hodgson

unread,
Nov 21, 2016, 11:50:47 PM11/21/16
to Scintilla mailing list
Thank you for your answers. But I still haven't solved my problem.  I used the way you said
it can display more than one word in the list.

But I select the second row of the list and press enter, Only one word is displayed in the text------ "JUMP"..  And not showing all the words "JUMP KA KKUKD”

   Here is an image of Scintilla displaying a list containing spaced items after selecting one spaced item “Battlestar Galactica” and adding it to the text:

   The code looks like this (after omitting the icon set up):
        const char *words = "Babylon 5?1\nBattlestar Galactica\nMillennium Falcon?2\nMoya?2\nSerenity\nVoyager";
        [mEditor setGeneralProperty: SCI_AUTOCSETIGNORECASE parameter: 1 value:0];
        [mEditor setGeneralProperty: SCI_AUTOCSETSEPARATOR parameter: '\n' value:0];
        [mEditor setGeneralProperty: SCI_AUTOCSHOW parameter: 0 value:(sptr_t)words];

   Neil

9702...@qq.com

unread,
Nov 22, 2016, 3:22:21 AM11/22/16
to scintilla-interest, nyama...@me.com


   The code looks like this (after omitting the icon set up):
        const char *words = "Babylon 5?1\nBattlestar Galactica\nMillennium Falcon?2\nMoya?2\nSerenity\nVoyager";
        [mEditor setGeneralProperty: SCI_AUTOCSETIGNORECASE parameter: 1 value:0];
        [mEditor setGeneralProperty: SCI_AUTOCSETSEPARATOR parameter: '\n' value:0];
        [mEditor setGeneralProperty: SCI_AUTOCSHOW parameter: 0 value:(sptr_t)words];

   Neil


Thanks a lot. I have tried the above interface. But it can't be achieved. I will try other ways.
Reply all
Reply to author
Forward
0 new messages