summaryrefslogtreecommitdiff
path: root/src/mainwin.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/mainwin.cc')
-rw-r--r--src/mainwin.cc14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/mainwin.cc b/src/mainwin.cc
index 72254a3..af4a532 100644
--- a/src/mainwin.cc
+++ b/src/mainwin.cc
@@ -180,7 +180,7 @@ MainWindow::MainWindow(const QString &filename)
fps = 0;
fsteps = 1;
- highlighter = NULL;
+ highlighter = new Highlighter(editor->document(), Highlighter::NORMAL_MODE);
editor->setTabStopWidth(30);
editor->setLineWrapping(true); // Not designable
@@ -1036,18 +1036,22 @@ bool MainWindow::compileTopLevelDocument(bool reload)
QFileInfo(this->fileName).absolutePath().toLocal8Bit(),
false);
- // Error highlighting
- delete this->highlighter;
- this->highlighter = NULL;
+ // Syntax & Error highlighting
if (!this->root_module) {
- this->highlighter = new Highlighter(editor->document());
+ if (highlighter->mode==Highlighter::NORMAL_MODE) {
+ delete this->highlighter;
+ highlighter = new Highlighter(editor->document(), Highlighter::ERROR_MODE);
+ }
if (!animate_panel->isVisible()) {
QTextCursor cursor = editor->textCursor();
cursor.setPosition(parser_error_pos);
editor->setTextCursor(cursor);
}
+ } else if (highlighter->mode==Highlighter::ERROR_MODE) {
+ delete this->highlighter;
+ this->highlighter = new Highlighter(editor->document(), Highlighter::NORMAL_MODE);
}
}
contact: Jan Huwald // Impressum