emoji-commit icon indicating copy to clipboard operation
emoji-commit copied to clipboard

🎉 Add editor input navigation

Open albinekb opened this issue 2 years ago • 4 comments

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 🤔

albinekb avatar Dec 25 '22 20:12 albinekb

This looks really nice!

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

LinusU avatar Dec 28 '22 17:12 LinusU

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

albinekb avatar Jan 02 '23 07:01 albinekb

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

cstruct avatar Jan 05 '23 07:01 cstruct