TrevorSatori / kronos

Terminal Music Player Written In Rust
GNU General Public License v3.0
52 stars 9 forks source link

feat: remember selected path #29

Closed lautarodragan closed 3 months ago

lautarodragan commented 3 months ago

Hey @TrevorSatori!

This PR adds a feature: remembering which path was selected when entering into a directory, and selecting it (rather than the first item of the directory list) when navigating upwards.


This is my first time writing Rust, so the code is probably pretty lousy. The for n in 0 looks like it could be more succinct (I couldn't find a native .findIndex or equivalent) and I'm not sure I'm passing the variables with the least scope possible, everywhere (borrowing immutably everywhere it's possible, etc).

The commit messages I wrote aren't useful outside the context of this PR, so if you do accept it, I think using the squash merge option would be ideal.

All feedback will be much appreciated :pray: