summaryrefslogtreecommitdiff
path: root/src/mainwin.cc
diff options
context:
space:
mode:
authorMarius Kintel <marius@kintel.net>2013-12-29 23:37:29 (GMT)
committerMarius Kintel <marius@kintel.net>2013-12-29 23:37:29 (GMT)
commitbf193472481d3e708da841d59df5f323e2785db7 (patch)
treeef8c6e33569ffdaed9af524500c7c8ede633c05a /src/mainwin.cc
parent9ea82e746cf4ff4c5c081e82fc0248d4d575ffdb (diff)
parent81a08c05c2d03aa8791279dfbcf7f9ca826fcf96 (diff)
Merge pull request #580 from openscad/colorsfix
Colorsfix - 3 options for syntax highlighter
Diffstat (limited to 'src/mainwin.cc')
-rw-r--r--src/mainwin.cc8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/mainwin.cc b/src/mainwin.cc
index 1ad8bc8..c2a7b7e 100644
--- a/src/mainwin.cc
+++ b/src/mainwin.cc
@@ -369,6 +369,8 @@ MainWindow::MainWindow(const QString &filename)
this, SLOT(setFont(const QString&,uint)));
connect(Preferences::inst(), SIGNAL(openCSGSettingsChanged()),
this, SLOT(openCSGSettingsChanged()));
+ connect(Preferences::inst(), SIGNAL(syntaxHighlightChanged(const QString&)),
+ this, SLOT(setSyntaxHighlight(const QString&)));
Preferences::inst()->apply();
// make sure it looks nice..
@@ -1899,6 +1901,12 @@ void MainWindow::setFont(const QString &family, uint size)
editor->setFont(font);
}
+void MainWindow::setSyntaxHighlight(const QString &s)
+{
+ this->highlighter->assignFormatsToTokens( s );
+ this->highlighter->rehighlight(); // slow on large files
+}
+
void MainWindow::quit()
{
QCloseEvent ev;
contact: Jan Huwald // Impressum