From 2ed01f2d9c8c98a7e59fef1bb19af56ec897084b Mon Sep 17 00:00:00 2001 From: CossonLeo Date: Sun, 24 Oct 2021 21:47:10 +0800 Subject: find motion and textobj motion repeat (#891) --- helix-view/src/editor.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'helix-view/src') diff --git a/helix-view/src/editor.rs b/helix-view/src/editor.rs index 51fe8a42..09fc3334 100644 --- a/helix-view/src/editor.rs +++ b/helix-view/src/editor.rs @@ -93,6 +93,18 @@ impl Default for Config { } } +pub struct Motion(pub Box); +impl Motion { + pub fn run(&self, e: &mut Editor) { + (self.0)(e) + } +} +impl std::fmt::Debug for Motion { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + f.write_str("motion") + } +} + #[derive(Debug)] pub struct Editor { pub tree: Tree, @@ -112,6 +124,7 @@ pub struct Editor { pub config: Config, pub idle_timer: Pin>, + pub last_motion: Option, } #[derive(Debug, Copy, Clone)] @@ -147,6 +160,7 @@ impl Editor { clipboard_provider: get_clipboard_provider(), status_msg: None, idle_timer: Box::pin(sleep(config.idle_timeout)), + last_motion: None, config, } } -- cgit v1.2.3-70-g09d2