[QScintilla] QScintilla suggestion to add dynamically to add keywords support

Detlev Offenbach detlev at die-offenbachs.de
Sun May 4 15:19:19 BST 2014


Hello,

the eric IDE allows to configure keywords for all supported lexers.

Detlev

On Friday 02 May 2014, 13:57:49 Phil Thompson wrote:
> On 01/05/2014 11:15 pm, Jeremi Roivas wrote:
> > Hello since I have looked the lexers it seams QScintilla api don't
> > support at the moment dynamic keyword handling.
> > 
> >  It seams that Lexer->readKeywords(int set) is there put some
> > 
> > funtionality to use dynamic keywordlists are missing.
> > 
> >  My suggestion to add functionality to QsciScintilla.h:
> >  
> >  void loadKeywords(int set, Qstring * keywords);
> >  
> >  QList returnKeywordTypes();
> >  
> >  for making array to handle sql databse saving and so on.
> >  
> >  This could add the dynamic keywords updating possible.
> 
> It's already possible. Sub-class your lexer and do something like...
> 
> const char *MyLexer::keywords(int set) const
> {
>      if (set == dynamic_set)
>          return dynamic_keywords;
> 
>      return QsciLexerAVS::keywords(set);
> }
> 
> void MyLexer::loadKeywords(int set, const char *keywords)
> {
>      dynamic_set = set;
>      dynamic_keywords = keywords;
> 
>      if (editor())
>          editor()->setLexer(this);
> }
> 
> Phil
> _______________________________________________
> QScintilla mailing list
> QScintilla at riverbankcomputing.com
> http://www.riverbankcomputing.com/mailman/listinfo/qscintilla-- 
*Detlev Offenbach*
detlev at die-offenbachs.de
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.riverbankcomputing.com/pipermail/qscintilla/attachments/20140504/e0cadedb/attachment.html>


More information about the QScintilla mailing list