File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -133,14 +133,15 @@ encodeDumpProject rawConfig format p
133133 | ConfigDumpYaml <- format = dumpProject (\ e d ->
134134 either (const e) encodeUtf8 (cfgRedress rawConfig d " " ))
135135 | ConfigDumpJson <- format = dumpProject (\ _ d ->
136- let cmp = cfgKeyCompare rawConfig d " "
137- in toStrictBytes $ encodePretty' (Aeson. defConfig{confCompare = cmp}) d)
136+ toStrictBytes $ encodePretty' (cfgPretty d) d)
138137 where
139138 -- REVIEW: Is there a way to encode straight to keymap?
140139 -- encode project to bytestring then decode to keymap.
141140 dumpProject f = let e = Yaml. encode p in Yaml. decodeEither' e &
142141 either (const e) (\ (d :: KeyMap Yaml. Value ) -> f e d)
143142
143+ cfgPretty d = Aeson. defConfig{confCompare = cfgKeyCompare rawConfig d " " }
144+
144145cfgKeyCompare :: RawYaml -> KeyMap Yaml. Value -> Text -> (Text -> Text -> Ordering )
145146cfgKeyCompare (yamlLines -> configLines) (fmap Key. toText . KeyMap. keys -> keys) cmdKey =
146147 compareInOrder configLines (coerce keys) (coerce cmdKey)
You can’t perform that action at this time.
0 commit comments