ChrisPenner / rasa

Extremely modular text editor built in Haskell
GNU General Public License v3.0
616 stars 42 forks source link

Optimizing Multiple-key bindings #17

Closed ChrisPenner closed 7 years ago

ChrisPenner commented 7 years ago

https://github.com/ChrisPenner/rasa/pull/15 Adds multi-key keymap bindings; however the way it does pattern matching is perhaps sub-optimal.

It may be possible to optimize it by using some form of 'Keymap tree' and perhaps a zipper into that tree; That allows us to traverse our way into the tree while still having an idea of which keys we could possible be waiting for, and allowing us to easily reset and allow us to replay the keypresses that didn't lead to a command when needed.

@robinvd

robinvd commented 7 years ago

The problem i have run into so far is that functions like 'f' need a variable to work. As it searches for something not known at compile time.

ChrisPenner commented 7 years ago

Closing for now; what we've got is working thanks to @robinvd ; we'll maybe re-open this in the future if it comes up again.