diff options
author | Don Bright <hugh.m.bright@gmail.com> | 2013-12-29 21:25:35 (GMT) |
---|---|---|
committer | Don Bright <hugh.m.bright@gmail.com> | 2013-12-29 21:25:35 (GMT) |
commit | f0e077269467ea38f54d517f4daea5c014a27df9 (patch) | |
tree | e80a5b791ca876673991bd55db95abac95b313c3 /src/mainwin.cc | |
parent | 6938ae2dfde578e3980d077adefb86a4bdbd9df1 (diff) |
enable disabling of syntax highlighter, add highlighter for dark backgrounds
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; |