diff options
author | Bent Bisballe Nyeng <deva@aasimon.org> | 2018-12-28 12:30:48 +0100 |
---|---|---|
committer | Bent Bisballe Nyeng <deva@aasimon.org> | 2018-12-28 12:30:48 +0100 |
commit | 16beb55484c20b8b1e92afdf5720fa3860d77309 (patch) | |
tree | ffb199f4c77247f1abef8091a5fc4ad459ecb224 /src/codeeditor.cc | |
parent | 0ee75305070f79b12cbfa5a31b17c543d0517428 (diff) |
Show error line in red in the editor.
Diffstat (limited to 'src/codeeditor.cc')
-rw-r--r-- | src/codeeditor.cc | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/codeeditor.cc b/src/codeeditor.cc index d639953..6d2dd2e 100644 --- a/src/codeeditor.cc +++ b/src/codeeditor.cc @@ -129,6 +129,16 @@ void CodeEditor::highlightCurrentLine() void CodeEditor::runningLine(int lineno) { lineNumber = lineno; + errorLineNumber = 0; // no error + repaint(); +} + +void CodeEditor::errorLine(QString file, int lineno, QString msg) +{ + (void)file; + (void)msg; + lineNumber = 0; + errorLineNumber = lineno; repaint(); } @@ -152,6 +162,10 @@ void CodeEditor::lineNumberAreaPaintEvent(QPaintEvent *event) { painter.setPen(Qt::green); } + else if(blockNumber + 1 == errorLineNumber) + { + painter.setPen(Qt::red); + } else { painter.setPen(Qt::black); |