ulyssa / modalkit

A Rust library for building modal editing applications
Apache License 2.0
58 stars 8 forks source link

Retry suffix of unmapped key sequences #126

Closed ulyssa closed 9 months ago

ulyssa commented 9 months ago

Currently, when an input sequence is unmapped, ModeKeys::unmapped gets called on just the last key in the sequence. This isn't the right behaviour, and makes it so that doing the common Insert mode mapping of "jj" or "jk" can't work right, since typing an unmapped sequence like "jo" will only type the "o" character. Instead, when a sequence is unmapped, ModeKeys::unmapped should be called on the first character, and then the rest of the sequence should be retries. That way, if "jk" is mapped to <Esc>, typing "jjk" will type "j" and then go to Normal mode.