mirror of https://github.com/vitalif/openscad
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-ec61d464b74cstl_dim
parent
5312d2fbba
commit
67106a40c7
|
@ -36,6 +36,7 @@ void Highlighter::highlightBlock(const QString &text)
|
||||||
QTextCharFormat style;
|
QTextCharFormat style;
|
||||||
style.setBackground(Qt::red);
|
style.setBackground(Qt::red);
|
||||||
setFormat(0, text.size(), style);
|
setFormat(0, text.size(), style);
|
||||||
|
style.setBackground(Qt::black);
|
||||||
style.setForeground(Qt::white);
|
style.setForeground(Qt::white);
|
||||||
setFormat(parser_error_pos - n, 1, style);
|
setFormat(parser_error_pos - n, 1, style);
|
||||||
}
|
}
|
||||||
|
|
|
@ -415,12 +415,8 @@ void MainWindow::compile(bool procevents)
|
||||||
delete highlighter;
|
delete highlighter;
|
||||||
highlighter = new Highlighter(editor->document());
|
highlighter = new Highlighter(editor->document());
|
||||||
|
|
||||||
if (!root_module) {
|
if (!root_module)
|
||||||
QTextCursor cursor = editor->textCursor();
|
|
||||||
cursor.setPosition(parser_error_pos);
|
|
||||||
editor->setTextCursor(cursor);
|
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
|
||||||
|
|
||||||
PRINT("Compiling design (CSG Tree generation)...");
|
PRINT("Compiling design (CSG Tree generation)...");
|
||||||
if (procevents)
|
if (procevents)
|
||||||
|
|
|
@ -220,7 +220,7 @@ CSGTerm *RenderNode::render_csg_term(double m[16], QVector<CSGTerm*> *highlights
|
||||||
QString RenderNode::dump(QString indent) const
|
QString RenderNode::dump(QString indent) const
|
||||||
{
|
{
|
||||||
if (dump_cache.isEmpty()) {
|
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)
|
foreach (AbstractNode *v, children)
|
||||||
text += v->dump(indent + QString("\t"));
|
text += v->dump(indent + QString("\t"));
|
||||||
((AbstractNode*)this)->dump_cache = text + indent + "}\n";
|
((AbstractNode*)this)->dump_cache = text + indent + "}\n";
|
||||||
|
|
Loading…
Reference in New Issue