ulyssa / modalkit

A Rust library for building modal editing applications
Apache License 2.0
49 stars 5 forks source link

Clarify application-specific customization #60

Closed ulyssa closed 1 year ago

ulyssa commented 1 year ago

I'm not crazy about how using the Application trait works at the moment. I think it needs to not be a trait for the application itself, but a never-constructed type that exists just to provide information to modalkit. I'm going to rename it to be ApplicationInfo.

I also don't like how using the SharedStore works at the moment. I have found it easy to end up in awkward situations in iamb where the store mutex gets acquired twice in the same thread, and crashes. The EditBuffer and widgets shouldn't hold onto a reference to the store, but instead should get passed a mutable reference during editing actions. This should simplify locking in iamb, and also allow applications to choose whether they even want to wrap it in a mutex. (For example, I'm going to make it so that the readline module doesn't wrap the Store at all, since it's single-threaded and won't need it.)