LinusU / emoji-commit

44 stars 6 forks source link

🎉 Add editor input navigation #21

Open albinekb opened 1 year ago

albinekb commented 1 year ago

This adds support for moving left/right in the message editor, also supports alt+left|right to move between words.

termion added support for AltLeft & AltRight but it was removed before it was released, don't know what happened there... https://gitlab.redox-os.org/redox-os/termion/-/commit/d96c13560c2600fdb5100ff67ae98d65bf12c56c

I made a workaround by setting is_control_input and then handling the escaped character, maybe there's a better way 🤔

LinusU commented 1 year ago

This looks really nice!

I've created an account at their GitLab server to ask about it, waiting for the account to get approved

albinekb commented 1 year ago

I tested the commit that added AltLeft and AltRight, it didn't seem to work I also tested crossterm, they have solved it with terminal integrations, so only works in some places: https://docs.rs/crossterm/latest/crossterm/event/struct.PushKeyboardEnhancementFlags.html

I think the hack is fine for now :D I have used it and it works as expected

cstruct commented 1 year ago

I'd much prefer if a proper line editor like rustyline was used.