Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'src/edi/input_handlers.rs')
-rw-r--r--src/edi/input_handlers.rs12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/edi/input_handlers.rs b/src/edi/input_handlers.rs
index 6457787..aa9e6a3 100644
--- a/src/edi/input_handlers.rs
+++ b/src/edi/input_handlers.rs
@@ -8,7 +8,7 @@ use crate::edi::*;
pub fn handle2<'a>(
key: &'a Key,
text: &mut TextArea,
- l: Option<(&Client, &Path)>,
+ l: Option<(Arc<Client>, &Path)>,
) -> Option<&'a str> {
use Key::*;
@@ -58,3 +58,13 @@ pub fn handle2<'a>(
};
None
}
+impl Editor {
+ #[track_caller]
+ pub fn transition(&mut self, a: Action) -> Option<Do> {
+ self.state
+ .consume(a)
+ .inspect_err(|e| log::error!("transition failed: {e}"))
+ .ok()
+ .flatten()
+ }
+}