kamiyaa / joshuto

ranger-like terminal file manager written in Rust
https://crates.io/crates/joshuto
GNU Lesser General Public License v3.0
3.34k stars 151 forks source link

feat: add `case_sensitive_ext` option for mimetype, theme and icons #497

Closed Akmadan23 closed 3 months ago

Akmadan23 commented 4 months ago

Currently any file with an uppercase or partially uppercase extension is not recognized by either mimetype.toml, theme.toml and icons.toml. With this addition, when the flag is set to false, any uppercase/lowercase variant of an extension will be correctly detected. I set it to false by default because it just makes sense to me, but we can set it to true if we want to keep the current behavior by default.

Akmadan23 commented 4 months ago

Here is the new implementation, which involves a lot of extra clones, not sure if that's better than having a static config.

Speaking of clones, I was wondering if it would be a good idea to do a major refactor using only one static config (like THEME_T, MIMETYPE_T, etc.) and keeping in the context just a minimal config to be used only for mutable values. It would drastically decrease clones and improve both memory and cpu performance. Let me know your thoughts on this...

kamiyaa commented 3 months ago

Here is the new implementation, which involves a lot of extra clones, not sure if that's better than having a static config.

Speaking of clones, I was wondering if it would be a good idea to do a major refactor using only one static config (like THEME_T, MIMETYPE_T, etc.) and keeping in the context just a minimal config to be used only for mutable values. It would drastically decrease clones and improve both memory and cpu performance. Let me know your thoughts on this...

Yeah, the issue is with static, its read-only I believe. So we won't be able to modify the configs (ie. show_hidden). I guess we can get around this with an Arc<> or something