From e6a6e251c5cb2c373584187c3d4d17b3eaac6b6a Mon Sep 17 00:00:00 2001
From: Bob <QiBaobin@users.noreply.github.com>
Date: Wed, 13 Jul 2022 23:00:24 +0800
Subject: [PATCH] respect count for repeating motion (#3057)

---
 helix-term/src/commands.rs | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs
index 193d5d40..cb223faf 100644
--- a/helix-term/src/commands.rs
+++ b/helix-term/src/commands.rs
@@ -1224,9 +1224,12 @@ fn extend_prev_char(cx: &mut Context) {
 }
 
 fn repeat_last_motion(cx: &mut Context) {
+    let count = cx.count();
     let last_motion = cx.editor.last_motion.take();
     if let Some(m) = &last_motion {
-        m.run(cx.editor);
+        for _ in 0..count {
+            m.run(cx.editor);
+        }
         cx.editor.last_motion = last_motion;
     }
 }