Don't syntax highlight table names in the middle of other identifiers

Assuming you have a table names 't', the syntax highlighter would have
highlighted all ts in column names and other identifiers which aren't
highlighted otherwise. This is fixed by this commit.
This commit is contained in:
Martin Kleusberg
2014-11-09 12:16:19 +01:00
parent 6e38cbcb1d
commit 7cfd80621e

View File

@@ -101,7 +101,7 @@ void SQLiteSyntaxHighlighter::setTableNames(const QStringList &tablenames)
tableNameRules.clear();
foreach(const QString& tblname, tablenames) {
HighlightingRule rule;
rule.pattern = QRegExp(tblname);
rule.pattern = QRegExp(QString("\\b%1\\b").arg(tblname));
rule.format = tableFormat;
tableNameRules.append(rule);
}