From 4af4554409b308ba95d1209c4b17dd405085c9c5 Mon Sep 17 00:00:00 2001 From: Montel Laurent Date: Fri, 2 Jan 2015 08:59:35 +0100 Subject: [PATCH] Fix hightlighting and autocompleter --- templateparser/templatessyntaxhighlighter.cpp | 2 +- templateparser/templatesutil.cpp | 20 +++++++++++++++++++ templateparser/templatesutil.h | 2 +- 3 files changed, 22 insertions(+), 2 deletions(-) diff --git a/templateparser/templatessyntaxhighlighter.cpp b/templateparser/templatessyntaxhighlighter.cpp index c1481ed114..a75c833783 100644 --- a/templateparser/templatessyntaxhighlighter.cpp +++ b/templateparser/templatessyntaxhighlighter.cpp @@ -47,7 +47,7 @@ void TemplatesSyntaxHighlighter::init() QTextCharFormat keywordWithArgsFormat; keywordWithArgsFormat.setForeground( palette.link() ); - const QStringList keywordsWithArgs = QStringList() << Util::keywordsWithArgs(); + const QStringList keywordsWithArgs = QStringList() << Util::keywordsWithArgsForCompleter(); Q_FOREACH ( const QString & s, keywordsWithArgs ) { const QRegExp regex( s, Qt::CaseInsensitive ); diff --git a/templateparser/templatesutil.cpp b/templateparser/templatesutil.cpp index bcfc51e7de..65c5ee55b8 100644 --- a/templateparser/templatesutil.cpp +++ b/templateparser/templatesutil.cpp @@ -36,6 +36,26 @@ void TemplateParser::Util::deleteTemplate( const QString &id ) } QStringList TemplateParser::Util::keywordsWithArgs() +{ + QStringList keywordsWithArgs; + keywordsWithArgs + << QLatin1String( "%REM=\"\"%-" ) + << QLatin1String( "%INSERT=\"\"" ) + << QLatin1String( "%SYSTEM=\"\"" ) + << QLatin1String( "%PUT=\"\"" ) + << QLatin1String( "%QUOTEPIPE=\"\"" ) + << QLatin1String( "%MSGPIPE=\"\"" ) + << QLatin1String( "%BODYPIPE=\"\"" ) + << QLatin1String( "%CLEARPIPE=\"\"" ) + << QLatin1String( "%TEXTPIPE=\"\"" ) + << QLatin1String( "%OHEADER=\"\"" ) + << QLatin1String( "%HEADER=\"\"" ) + << QLatin1String( "%LANGUAGE=\"\"" ); + + return keywordsWithArgs; +} + +QStringList TemplateParser::Util::keywordsWithArgsForCompleter() { QStringList keywordsWithArgs; keywordsWithArgs diff --git a/templateparser/templatesutil.h b/templateparser/templatesutil.h index d1f66c176a..9c2a996a37 100644 --- a/templateparser/templatesutil.h +++ b/templateparser/templatesutil.h @@ -30,7 +30,7 @@ TEMPLATEPARSER_EXPORT void deleteTemplate( const QString &id ); TEMPLATEPARSER_EXPORT QStringList keywords(); TEMPLATEPARSER_EXPORT QStringList keywordsWithArgs(); - +TEMPLATEPARSER_EXPORT QStringList keywordsWithArgsForCompleter(); } } -- GitLab