diff --git a/src/MemoWindow.cpp b/src/MemoWindow.cpp index d21aa4b8..7e6d0af3 100644 --- a/src/MemoWindow.cpp +++ b/src/MemoWindow.cpp @@ -216,13 +216,15 @@ class MemoHighlighter : public QSyntaxHighlighter protected: const QVector& rules() const { - static QVector rules = { - { - .expr = QRegularExpression("\\bhttp(s?)://[^\\s]+\\b"), - .format = MemoTextFormat("blue").underline().get(), - .hyperlink = true, - } - }; + static QVector rules; + if (rules.isEmpty()) + { + Rule rule; + rule.expr = QRegularExpression("\\bhttp(s?)://[^\\s]+\\b"); + rule.format = MemoTextFormat("blue").underline().get(); + rule.hyperlink = true; + rules << rule; + } return rules; }