LaTeXHighlighter::LaTeXHighlighter(QTextDocument * parent, bool at_letter, bool keyval)
: QSyntaxHighlighter(parent), at_letter_(at_letter), keyval_(keyval)
+{
+ setupColors();
+}
+
+
+void LaTeXHighlighter::setupColors()
{
auto blend = [](QColor color1, QColor color2) {
int r = 0.5 * (color1.red() + color2.red());
if (keyval_) {
// Highlight key-val options. Used in some option widgets.
// 1. The keys. Might or might not have values
- static QRegularExpression exprKeyvalkey("[^=,{]+");
+ static QRegularExpression exprKeyvalkey("[^=,}]+");
// 2. These are grouped values such as "key1={val,val},key2=val"
static QRegularExpression exprKeyvalgval("[^=,{]+{[^}]+}");
// 3. And normal values if we don't find grouped ones