Clifford Wolf:

Improved error highlighting
	Fixed caching bug in render() statement



git-svn-id: http://svn.clifford.at/openscad/trunk@129 b57f626f-c46c-0410-a088-ec61d464b74c
stl_dim
clifford 2009-11-05 20:17:08 +00:00
parent 5312d2fbba
commit 67106a40c7
3 changed files with 3 additions and 6 deletions

View File

@ -36,6 +36,7 @@ void Highlighter::highlightBlock(const QString &text)
QTextCharFormat style;
style.setBackground(Qt::red);
setFormat(0, text.size(), style);
style.setBackground(Qt::black);
style.setForeground(Qt::white);
setFormat(parser_error_pos - n, 1, style);
}

View File

@ -415,12 +415,8 @@ void MainWindow::compile(bool procevents)
delete highlighter;
highlighter = new Highlighter(editor->document());
if (!root_module) {
QTextCursor cursor = editor->textCursor();
cursor.setPosition(parser_error_pos);
editor->setTextCursor(cursor);
if (!root_module)
goto fail;
}
PRINT("Compiling design (CSG Tree generation)...");
if (procevents)

View File

@ -220,7 +220,7 @@ CSGTerm *RenderNode::render_csg_term(double m[16], QVector<CSGTerm*> *highlights
QString RenderNode::dump(QString indent) const
{
if (dump_cache.isEmpty()) {
QString text = indent + QString("n%1: ").arg(idx) + QString("render() {\n");
QString text = indent + QString("n%1: ").arg(idx) + QString("render(convexity = %1) {\n").arg(QString::number(convexity));
foreach (AbstractNode *v, children)
text += v->dump(indent + QString("\t"));
((AbstractNode*)this)->dump_cache = text + indent + "}\n";