kamiyaa / joshuto

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

feat: Add rename_file_append_ext command #423

Closed rqdmap closed 11 months ago

rqdmap commented 11 months ago

This command renames a file with the cursor set to the end of the file name.

kamiyaa commented 11 months ago

Good stuff! But I think the name is a bit confusing. It might be a better idea to swap the functionality of rename_append and rename_append_ext. And maybe renaming it to rename_prepend_ext

rename_append puts cursor to the end of file (appending to the file) rename_prepend_ext puts cursor right before extension (prepending to the extension)

AKA

rename_append -> rename_prepend_ext rename_append_ext -> rename_append

Kind of scope creep, but what do you think?

rqdmap commented 11 months ago

I mostly agree with you about these confusing names. It seems better to let rename_append act like the previous rename_append_ext.

But I want to reserve the ability to directly append to the file name without touching the extension. This functionality is quite frequently used I think. So I want to reserve it by naming it more reasonably. I did some research and found some naming methods for describing filename without extension:

I'm not sure which one is better(unambiguous and clear). I prefer rename_append_base because it seems simple and intuitive.

To sum up:

It looks good; What do you think of the new naming method?

kamiyaa commented 11 months ago

rename_append_base is good for me :+1: