Bug 398758 - Syntax highlighting doesn't use chosen theme (default style broken)
Summary: Syntax highlighting doesn't use chosen theme (default style broken)
Status: RESOLVED FIXED
Alias: None
Product: frameworks-ktexteditor
Classification: Frameworks and Libraries
Component: general (other bugs)
Version First Reported In: 5.50.0
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-09-17 14:15 UTC by Wouter Van Hemel
Modified: 2019-04-03 07:23 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In: 5.57.0
Sentry Crash Report:


Attachments
normal scheme (246.24 KB, image/png)
2018-11-04 23:26 UTC, Mathias Kraus
Details
breeze dark scheme (245.37 KB, image/png)
2018-11-04 23:27 UTC, Mathias Kraus
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Wouter Van Hemel 2018-09-17 14:15:34 UTC
Hello,

Since the last update of Frameworks to 5.50.0, Kate and Kwrite ignore most of the chosen theme's highlighting colours.

I use the Solarized (dark) theme as default and since the update, apart for the background, most colours seem to come from somewhere else.

It seems the default colours are never set to the selected "Default scheme for kate".

I can go to the "Highlighting Text Styles" tab and click the "Use Default Style" checkbox for each type and each language, but that's silly.

Is this a known problem?
Comment 1 Heinz Wiesinger 2018-10-23 07:31:14 UTC
I can confirm this behavior (with frameworks 5.51.0 here).
This is especially annoying now when using dark themes as it makes everything really hard to read.
Comment 2 Mathias Kraus 2018-11-04 23:26:26 UTC
Created attachment 116089 [details]
normal scheme

normal scheme for C++ on new user account
Comment 3 Mathias Kraus 2018-11-04 23:27:21 UTC
Created attachment 116090 [details]
breeze dark scheme

breeze dark scheme for C++ on new user account
Comment 4 Mathias Kraus 2018-11-04 23:30:26 UTC
I can confirm this on frameworks 5.51 on kde neon. It seems it started with the port to ksyntaxhighlighting. It's a bit weird though.

With a new user account, the colors for C++ don't change for any color scheme. For QML files the highlighting changes with the color scheme.

For my user account, the behavior is the opposite. It works for C++ files but doesn't work for QML files.
Comment 5 Nibaldo G. 2019-01-10 19:19:39 UTC
+1
I also confirm it in KF5.53, the normal schema is always used. When changing the schema, only the background color and dsNormal/dsKeyword/dsOperator changes.

This is uncomfortable in dark schemes
Comment 6 Nibaldo G. 2019-04-03 07:22:07 UTC
Git commit c922bc8352ac3a65b373f26070694d760d05e6b6 by Nibaldo González.
Committed on 03/04/2019 at 07:21.
Pushed by ngonzalez into branch 'master'.

Fix: apply correctly the text colors of the chosen scheme

Summary:

Since the implementation of KSyntaxHighlighting in KF5.50, KTextEditor always uses the "Normal" scheme for text colors.

Previously, the colors were set according to `KSyntaxHighlighting::Repository::LightTheme`, which corresponds to the "Normal" scheme. ~~Now use KateRendererConfig::global() to get the name of the current selected scheme.~~

Before:
{F6701315}

After:
{F6701318}

Reviewers: #ktexteditor, #kate, cullmann, mwolff

Reviewed By: #ktexteditor, #kate, cullmann

Subscribers: mwolff, cullmann, dhaumann, kwrite-devel, kde-frameworks-devel

Tags: #kate, #frameworks

Differential Revision: https://phabricator.kde.org/D19876

M  +32   -5    src/syntax/katehighlight.cpp
M  +2    -1    src/syntax/katehighlight.h

https://commits.kde.org/ktexteditor/c922bc8352ac3a65b373f26070694d760d05e6b6