We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6a44e11 commit f854acbCopy full SHA for f854acb
src/gui/qgsexpressionhighlighter.cpp
@@ -50,6 +50,8 @@ void QgsExpressionHighlighter::addFields( QStringList fieldList )
50
HighlightingRule rule;
51
foreach( const QString field, fieldList )
52
{
53
+ if ( field.isEmpty() ) // this really happened :)
54
+ continue;
55
rule.pattern = QRegExp( "\\b" + field + "\\b" );
56
rule.format = columnNameFormat;
57
highlightingRules.append( rule );
@@ -65,6 +67,8 @@ void QgsExpressionHighlighter::highlightBlock( const QString &text )
65
67
while ( index >= 0 )
66
68
69
int length = expression.matchedLength();
70
+ if ( length == 0 )
71
+ break; // avoid infinite loops
72
setFormat( index, length, rule.format );
73
index = expression.indexIn( text, index + length );
74
}
0 commit comments