From 16beb55484c20b8b1e92afdf5720fa3860d77309 Mon Sep 17 00:00:00 2001 From: Bent Bisballe Nyeng Date: Fri, 28 Dec 2018 12:30:48 +0100 Subject: Show error line in red in the editor. --- src/codeeditor.cc | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/codeeditor.cc') 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); -- cgit v1.2.3