diff options
Diffstat (limited to 'src/mainwin.cc')
-rw-r--r-- | src/mainwin.cc | 8 |
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; |