# HG changeset patch # User Jacob Dawid # Date 1302102049 -7200 # Node ID 01eb3fd5faf56b8e8685bf8e4d7feb78f893f919 # Parent 0a3a2d4e3d8613b54fdfb114ee582f0f8acd8cf2 Added some syntax highlighting. diff --git a/gui//terminalhighlighter.cpp b/gui//terminalhighlighter.cpp --- a/gui//terminalhighlighter.cpp +++ b/gui//terminalhighlighter.cpp @@ -25,7 +25,6 @@ HighlightingRule rule; keywordFormat.setForeground(Qt::darkRed); - keywordFormat.setFontWeight(QFont::Bold); QStringList keywordPatterns; keywordPatterns << "\\bOctave\\b" << "\\bGNU\\b"; @@ -35,6 +34,17 @@ highlightingRules.append(rule); } + promptFormat.setForeground(Qt::darkGreen); + rule.pattern = QRegExp("\\boctave:[0-9]+>"); + rule.format = promptFormat; + highlightingRules.append(rule); + + errorFormat.setForeground(Qt::red); + errorFormat.setFontWeight(QFont::Bold); + rule.pattern = QRegExp("\\berror:"); + rule.format = errorFormat; + highlightingRules.append(rule); + numberFormat.setForeground(Qt::darkGreen); numberFormat.setFontWeight(QFont::Bold); rule.pattern = QRegExp("\\b[0-9\\.]+[i]?\\b"); diff --git a/gui//terminalhighlighter.h b/gui//terminalhighlighter.h --- a/gui//terminalhighlighter.h +++ b/gui//terminalhighlighter.h @@ -47,6 +47,8 @@ QTextCharFormat quotationFormat; QTextCharFormat numberFormat; QTextCharFormat urlFormat; + QTextCharFormat errorFormat; + QTextCharFormat promptFormat; }; #endif // TERMINALHIGHLIGHTER_H