kamiyaa / joshuto

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

Make mouse support configurable #494

Closed Mroik closed 4 months ago

Mroik commented 4 months ago

Implements request of issue #402 for mouse support to be configurable through joshuto.toml instead of it being a cargo feature.

Mroik commented 4 months ago

I really dislike this solution, made me change the signature of some functions to pass context. I don't think this is avoidable due to the fact that Screen was an alias had different types based on the cargo features.

kamiyaa commented 4 months ago

I really dislike this solution, made me change the signature of some functions to pass context. I don't think this is avoidable due to the fact that Screen was an alias had different types based on the cargo features.

An alternative solution could be to keep the mouse feature, have it enabled by default and can be changed via config (the work you did). What do you think?

Mroik commented 4 months ago

An alternative solution could be to keep the mouse feature, have it enabled by default and can be changed via config (the work you did).

Not sure what you mean, as it is right now in this branch it is done only through the config (there wouldn't be a need for a cargo feature). What I was referring to is this. I don't think we can avoid an enum given that the previous implementation for the mouse support toggle via cargo feature achieved it through different types.

Ideally I would like turning off mouse support to be able to select text. As it is, when mouse is enabled or disabled, text cannot be selected via mouse.

After the latest commits this is achieved tho, what you wanted should be the current behaviour.

Mroik commented 4 months ago

Not sure if I explained myself, sorry if I wasn't too clear :sweat_smile:

kamiyaa commented 4 months ago

Okay, this is fine. I am content with this haha.

kamiyaa commented 4 months ago

Thanks!