Sort returned formats in Definition::formats() by id
ClosedPublic

Authored by dhaumann on Aug 10 2018, 12:47 PM.

Details

Summary

Sorting the formats() by id results in the same order as the
itemDatas are defined in the xml file. This is required for
several reasons:

  • KTextEditor currently uses the first format if no format was explicitly specified (which typically is "Normal Text")
  • Fonts & Colors will list the itemDatas in correct order
  • Printing the syntax guide is sorted correctly as well
Test Plan

make && make test

Diff Detail

Repository
R216 Syntax Highlighting
Branch
sort-formats (branched from master)
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 1677
Build 1695: arc lint + arc unit
dhaumann created this revision.Aug 10 2018, 12:47 PM
Restricted Application added projects: Kate, Frameworks. · View Herald TranscriptAug 10 2018, 12:47 PM
Restricted Application added subscribers: kde-frameworks-devel, kwrite-devel. · View Herald Transcript
dhaumann requested review of this revision.Aug 10 2018, 12:47 PM
dhaumann updated this revision to Diff 39411.Aug 10 2018, 1:39 PM
  • Update comment
cullmann accepted this revision.Aug 10 2018, 1:50 PM

I think any sorting is better than the current "random" hash order.

This revision is now accepted and ready to land.Aug 10 2018, 1:50 PM
This revision was automatically updated to reflect the committed changes.