Skip to content

Commit

Permalink
fix: some themes do not highlight.
Browse files Browse the repository at this point in the history
Change-Id: I0ae0ffcf24326f8608cb9a395f6d299d761772f7
  • Loading branch information
rekols committed Aug 29, 2018
1 parent c2de5c3 commit 15fd8fb
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion editor/src/texteditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1990,8 +1990,14 @@ void TextEditor::setTheme(const KSyntaxHighlighting::Theme &theme, QString theme
m_selectionColor = QColor(jsonMap["editor-colors"].toMap()["selection"].toString());
m_regionMarkerColor = QColor(theme.textColor(KSyntaxHighlighting::Theme::RegionMarker));

m_highlighter->setTheme(theme);
if (QColor(m_backgroundColor).lightness() < 128) {
m_highlighter->setTheme(m_repository.defaultTheme(KSyntaxHighlighting::Repository::DarkTheme));
} else {
m_highlighter->setTheme(m_repository.defaultTheme(KSyntaxHighlighting::Repository::LightTheme));
}

m_highlighter->rehighlight();

lineNumberArea->update();

highlightCurrentLine();
Expand Down

0 comments on commit 15fd8fb

Please sign in to comment.