Closed thinkingreed closed 3 months ago
I think the reason why you are seeing this error is because you are trying to deserialize a single .tmTheme
file into a theme set. If you look at https://docs.rs/crate/syntect/latest/source/src/dumps.rs, you'll see it deserializes .packdump
files. Probably the correct approach is to - as part of a separate code path - use ThemeSet
add_from_folder
, then dump_to_file
, and then from_binary(include_bytes!
( that resulting file.
Thank you for your response. It would have been better to output the .tmTheme file to a dmp file and read that file. solved. I was only thinking about how to read directly from the .tmTheme file. Thank you from the bottom of my heart.
I would like to read the .tmTmeme file of assets in the project and use it in the theme, but I do not know how to do it, so I would appreciate if you could teach me how. ■Executed code
let theme_set: ThemeSet = from_binary(include_bytes!("assets/test.tmTheme"));
*from_binary is the from_binary function of dumps.rs. ■Errors that occurIo(Custom { kind: InvalidInput, error: "corrupt deflate stream" })