gchp / iota

A terminal-based text editor written in Rust
MIT License
1.62k stars 80 forks source link

Added Home/End and Ctrl-Arrow bindings #139

Closed jncraton closed 6 years ago

jncraton commented 6 years ago

This pulls in 4 actions (next/prev word and goto start/end of line) present in emacs mode and binds them to the modern GUI keys.

Binding to Ctrl-Left and Crtl-Right required parsing multibyte terminal control sequences. These aren't available everywhere (e.g. xterm works but a raw tty on Linux does not). I moved a little more event handling logic into the keyboard module, as the function that handles key presses now needs to be able to check if there are additional keyboard events waiting when it receives the start of an escape sequence.

gchp commented 6 years ago

Cool! Thanks!