Fix: allow turn off attributes in XML highlighting files
ClosedPublic

Authored by nibags on Aug 25 2019, 10:22 AM.

Details

Summary

In syntax highlighting XML files, it doesn't work to turn off attributes, for example: bold="0", italic="0" or underline="0".

This is fixed, but only for KSyntaxHighlighting themes, that is, this continues to not work in "KDE" and "Vim (dark)".

To correct that it is necessary to add to the API of the KSyntaxHighlighting::Format class, methods such as hasBold(), hasItalic(), etc. to know if the attributes "bold", "italic", "underline" & "strikeout" are modified in the XML file (the methods isBold(...), isItalic(...), etc., return the combination between the syntax definition and the theme).

Diff Detail

Repository
R39 KTextEditor
Branch
master
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 15614
Build 15632: arc lint + arc unit
nibags created this revision.Aug 25 2019, 10:22 AM
Restricted Application added projects: Kate, Frameworks. · View Herald TranscriptAug 25 2019, 10:22 AM
Restricted Application added subscribers: kde-frameworks-devel, kwrite-devel. · View Herald Transcript
nibags requested review of this revision.Aug 25 2019, 10:22 AM
cullmann accepted this revision.Aug 25 2019, 10:27 AM

I think this is a good start to fix this issue.

Would you be willing to provide the needed extensions to the KSyntaxHighlighting API, too?

This is related to this bug. or?

https://bugs.kde.org/show_bug.cgi?id=143399

This revision is now accepted and ready to land.Aug 25 2019, 10:27 AM

Yes, it has to do with that bug.
Later I will add the functions to the KSyntaxHighlighting API to correct this.

nibags closed this revision.Aug 25 2019, 10:35 AM

Great!

Feel free to commit this.

Btw., I really appreciate all the work you do to improve the highlighting!

I was astonished that we already amassed more than 300 highlighting files in total:

https://kate-editor.org/syntax/

Yes, thanks a lot!