11use std:: {
2- collections:: HashSet ,
2+ collections:: { BTreeMap , HashSet } ,
33 fmt:: Write ,
44 fs,
55 io:: { self , Write as _} ,
@@ -12,7 +12,6 @@ use std::{
1212use ansi_colours:: { ansi256_from_rgb, rgb_from_ansi256} ;
1313use anstyle:: { Ansi256Color , AnsiColor , Color , Effects , RgbColor } ;
1414use anyhow:: Result ;
15- use indexmap:: IndexMap ;
1615use serde:: { ser:: SerializeMap , Deserialize , Deserializer , Serialize , Serializer } ;
1716use serde_json:: { json, Value } ;
1817use tree_sitter_highlight:: { HighlightConfiguration , HighlightEvent , Highlighter , HtmlRenderer } ;
@@ -83,7 +82,7 @@ impl<'de> Deserialize<'de> for Theme {
8382 {
8483 let mut styles = Vec :: new ( ) ;
8584 let mut highlight_names = Vec :: new ( ) ;
86- if let Ok ( colors) = IndexMap :: < String , Value > :: deserialize ( deserializer) {
85+ if let Ok ( colors) = BTreeMap :: < String , Value > :: deserialize ( deserializer) {
8786 highlight_names. reserve ( colors. len ( ) ) ;
8887 styles. reserve ( colors. len ( ) ) ;
8988 for ( name, style_value) in colors {
@@ -128,7 +127,7 @@ impl Serialize for Theme {
128127 || effects. contains ( Effects :: ITALIC )
129128 || effects. contains ( Effects :: UNDERLINE )
130129 {
131- let mut style_json = IndexMap :: new ( ) ;
130+ let mut style_json = BTreeMap :: new ( ) ;
132131 if let Some ( color) = color {
133132 style_json. insert ( "color" , color) ;
134133 }
0 commit comments