Skip to content
Snippets Groups Projects
Commit 42fbb45b authored by Roberto Raggi's avatar Roberto Raggi
Browse files

Report only one error message for line (well, at least for now).

parent f2992430
No related branches found
No related tags found
No related merge requests found
...@@ -283,10 +283,15 @@ void GLSLTextEditor::updateDocumentNow() ...@@ -283,10 +283,15 @@ void GLSLTextEditor::updateDocumentNow()
warningFormat.setUnderlineColor(Qt::darkYellow); warningFormat.setUnderlineColor(Qt::darkYellow);
QList<QTextEdit::ExtraSelection> sels; QList<QTextEdit::ExtraSelection> sels;
QSet<int> errors;
foreach (const DiagnosticMessage &m, engine.diagnosticMessages()) { foreach (const DiagnosticMessage &m, engine.diagnosticMessages()) {
if (! m.line()) if (! m.line())
continue; continue;
else if (errors.contains(m.line()))
continue;
errors.insert(m.line());
QTextCursor cursor(document()->findBlockByNumber(m.line() - 1)); QTextCursor cursor(document()->findBlockByNumber(m.line() - 1));
cursor.movePosition(QTextCursor::EndOfBlock, QTextCursor::KeepAnchor); cursor.movePosition(QTextCursor::EndOfBlock, QTextCursor::KeepAnchor);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment