summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorclifford <clifford@b57f626f-c46c-0410-a088-ec61d464b74c>2009-12-18 07:51:26 (GMT)
committerclifford <clifford@b57f626f-c46c-0410-a088-ec61d464b74c>2009-12-18 07:51:26 (GMT)
commitcb147a8b82af998b641e5845d4dfad7ded908314 (patch)
tree272d6eda3b1e83144e9e38e835b8bc7ddfbb4535
parent237f7abadfdc6fd2b884a90621f4cea1a2ffdd87 (diff)
Clifford Wolf:
Improved editor performance by disabling syntax error highlighting when there is no syntax error to highlight git-svn-id: http://svn.clifford.at/openscad/trunk@182 b57f626f-c46c-0410-a088-ec61d464b74c
-rw-r--r--mainwin.cc11
1 files changed, 8 insertions, 3 deletions
diff --git a/mainwin.cc b/mainwin.cc
index 01a6b25..6649858 100644
--- a/mainwin.cc
+++ b/mainwin.cc
@@ -123,7 +123,7 @@ MainWindow::MainWindow(const char *filename)
fps = 0;
fsteps = 1;
- highlighter = new Highlighter(editor->document());
+ highlighter = NULL;
QFont font;
font.setStyleHint(QFont::TypeWriter);
@@ -490,8 +490,13 @@ void MainWindow::compile(bool procevents)
last_compiled_doc = editor->toPlainText();
root_module = parse((last_compiled_doc + "\n" + commandline_commands).toAscii().data(), false);
- delete highlighter;
- highlighter = new Highlighter(editor->document());
+ if (highlighter) {
+ delete highlighter;
+ highlighter = NULL;
+ }
+ if (parser_error_pos >= 0) {
+ highlighter = new Highlighter(editor->document());
+ }
if (!root_module) {
if (!animate_panel->isVisible()) {
contact: Jan Huwald // Impressum