Bug 312430

Summary: Mapping of 'Highlighting Text Styles' to 'Default Text Styles': local config file overrides syntax file
Product: [Applications] kate Reporter: SB <simonbachmann>
Component: syntaxAssignee: KWrite Developers <kwrite-bugs-null>
Status: RESOLVED WORKSFORME    
Severity: minor CC: a.samirh78, justin.zobel, loh.tar
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description SB 2012-12-31 13:17:42 UTC
The language-specific Highlighting Text Styles are usually mapped to Default Text Styles. 
This mapping is specified in the syntax files ($KDEDIR/share/apps/katepart/syntax/*.xml).
If the user makes changes to 'Editor Component'/'Font & Colors' configuration, this mapping gets saved in the local configuration too (~/.kde4/share/config/katesyntaxhighlightingrc). 
Now, the local configuration overrides the system-wide syntax files.
This is good where the user personalised a language-specific Highlighting Text Style.
It is BAD for Highlight Text Styles that are not personalised ("Use Default Style" checked in config dialog): if the global mapping changes (->software update) kate keeps using the old mapping (saved in local config).

Reproducible: Always

Steps to Reproduce:
Using C Highlighting as an example - 'works' with every language
1. Open configuration Window, go to Editor Component/Font & Colors
2. Select Tab 'Highlight Text Styles', in the 'Highlight' dropdown select 'Source/C'
3. Click 'OK' 
  -> No personalised configuration has been made
  -> There is a section '[Highlighting C - Schema kate - Normal]' in the local config file now (~/.kde4/share/config/katesyntaxhighlightingrc)
4. Open $KDEDIR/share/apps/katepart/syntax/c.xml and change -as an Example- the Default Style for 'Data Type':
175c175
<       <itemData name="Data Type"    defStyleNum="dsDataType" spellChecking="false"/>
---
>       <itemData name="Data Type"    defStyleNum="dsKeyword" spellChecking="false"/>
5. (Re)start kate and open a c source file
Actual Results:  
Data types (int, char, etc) are still displayed with the Default Style 'Data Type' 

Expected Results:  
Data types (int, char, etc) are now displayed with the Default Style 'Keyword'

Workaround: delete ~/.kde4/share/config/katesyntaxhighlightingrc or remove the corresponding section from that file
Comment 1 SB 2012-12-31 13:26:03 UTC
Forgot: Kate Version 3.9.4 
(Why isn't it in the list?)
Comment 2 Dominik Haumann 2015-10-08 21:36:25 UTC
In the long term, the proper fix is probably to just drop changing the individual colors of language styles. We introduced quite some additional default styles that should meet the requirements by most languages... If we drop language specific color settings, there will be complaints for sure, too.... hm...
Comment 3 Ahmad Samir 2019-03-04 09:57:55 UTC
IMHO, this should be closed as not a bug; this is the intended behaviour, for user changes to override system-wide settings, and it matches what most other apps do, i.e. if a global config is changed upstream, the user customised one will override unless the user "resets" it...
Comment 4 SB 2019-03-10 13:33:00 UTC
Premises:
1. I reported this bug long ago and don't remember any details
2. The issue might even no longer exist in current versions of kate
3. I have moved away from kate, so I can't really check this

Thats said, I'd recommend you have a close look at the reported problem before closing it as a non-bug. 
I dare say that I had a pretty good understanding on how the local vs. global settings should work when I reported this. If I reported this issue, it's because I was convinced that there is a good reason.
Comment 5 Lothar 2019-03-11 06:21:11 UTC
Perhaps is the title of this report not correct.

Didn't do test or looked closer, but after reading here it sounds to me that you only (has/want) to set some refercence as your wished default, but the config is written with some complete data set. So, when the referenced default was changed upstream, are still the old values used.
Comment 6 Dominik Haumann 2019-03-16 10:56:43 UTC
You can keep it open for now.
Comment 7 Justin Zobel 2020-10-30 04:43:41 UTC
(In reply to Dominik Haumann from comment #6)
> You can keep it open for now.

Dominik is this still an ongoing issue in Kate?
Comment 8 Bug Janitor Service 2020-11-14 04:33:44 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least
15 days. Please provide the requested information as soon as
possible and set the bug status as REPORTED. Due to regular bug
tracker maintenance, if the bug is still in NEEDSINFO status with
no change in 30 days the bug will be closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please
mark the bug as REPORTED so that the KDE team knows that the bug is
ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 9 Bug Janitor Service 2020-11-29 04:33:43 UTC
This bug has been in NEEDSINFO status with no change for at least
30 days. The bug is now closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

Thank you for helping us make KDE software even better for everyone!