summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorclifford <clifford@b57f626f-c46c-0410-a088-ec61d464b74c>2009-11-05 20:17:08 (GMT)
committerclifford <clifford@b57f626f-c46c-0410-a088-ec61d464b74c>2009-11-05 20:17:08 (GMT)
commit67106a40c7ab5baab8d879fb354e74bec722f5f6 (patch)
treeda94fc5aa3c5b70ac28d2fd61cec2adb02399e69
parent5312d2fbba47c5d8e0072e31fc50651888e0d63d (diff)
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
-rw-r--r--highlighter.cc1
-rw-r--r--mainwin.cc6
-rw-r--r--render.cc2
3 files changed, 3 insertions, 6 deletions
diff --git a/highlighter.cc b/highlighter.cc
index 7543b4d..017d6b2 100644
--- a/highlighter.cc
+++ b/highlighter.cc
@@ -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);
}
diff --git a/mainwin.cc b/mainwin.cc
index d63990e..cf17c88 100644
--- a/mainwin.cc
+++ b/mainwin.cc
@@ -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)
diff --git a/render.cc b/render.cc
index cfbd51e..3bb07de 100644
--- a/render.cc
+++ b/render.cc
@@ -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";
contact: Jan Huwald // Impressum