Davejkane / riv

Riv - The Rust Image Viewer
MIT License
99 stars 10 forks source link

Vim style navigation keys #3

Closed Davejkane closed 5 years ago

Davejkane commented 5 years ago

Currently the picture navigation keys are perhaps poorly chosen. Refactor the key handling code (in src/program.rs run function) to use J, K, L and ; to navigate images. I propose that J & K should move to next and previous image respectively, and the ; and L should do the same. Please retain the arrow keys, and also implement the up and down arrow keys.

This refactor will require that the K key, currently used for keeping an image, be changed. I propose M and renaming the keep function to move_current_image.

Add g and G (as in shift + G) to move to the first and last image in the collection respectively. This will require handling knowing whether or not the SHIFT key is current pressed and will require some slightly more tricky code.

In all of this remember to handle the case where the self.images Vec is length zero or one. Also update the table in the README to reflect the new controls. (formatting the table nicely would also be apprectiated).