From cb147a8b82af998b641e5845d4dfad7ded908314 Mon Sep 17 00:00:00 2001 From: clifford Date: Fri, 18 Dec 2009 07:51:26 +0000 Subject: 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 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()) { -- cgit v0.10.1