Kungsgeten / ryo-modal

Roll your own modal mode
MIT License
222 stars 14 forks source link

make ryo-modal-repeat remember prefix-arg #53

Closed casavaca closed 2 years ago

casavaca commented 2 years ago

Hi,

I started using ryo-modal recently and it's a great package.

This pull request changes the behavior of ryo-modal-repeat when previous command is applied with prefix argument.

Before the change, ryo-modal-repeat will call previous command but discards the prefix argument. This makes the result surprising sometimes. E.g., if we set (ryo-modal-keys ("k" kill-line)), then C-u -1 k (which kills lines backwards), then ryo-modal-repeat, we would expect that it continues to kill lines backwards. But since the prefix argument is discarded, the result is "Kill the rest of the current line".

The patch fixes that by remembering the prefix argument by ryo-modal--last-command-prefix-arg

It works fine for me. I think it's reasonable to make it the default behavior. But if you have other considerations, maybe consider adding something like (defcustom ryo-modal--remember-last-command-prefix-arg nil)?

It's great to be able to hear back from you.

Thanks!

Kungsgeten commented 2 years ago

Thanks! I don't think customization is necessary in this case.