From eb5f4774a0681989f843cd4bffa43bfbd4635404 Mon Sep 17 00:00:00 2001
From: Martin Aumueller <aumuell@reserv.at>
Date: Tue, 23 Dec 2008 22:03:44 +0100
Subject: [PATCH] fakevim: yanking/deleting/changing by line would act on one
 line to few

---
 src/plugins/fakevim/fakevimhandler.cpp | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/src/plugins/fakevim/fakevimhandler.cpp b/src/plugins/fakevim/fakevimhandler.cpp
index 12ff3c713cc..53f3fa26b02 100644
--- a/src/plugins/fakevim/fakevimhandler.cpp
+++ b/src/plugins/fakevim/fakevimhandler.cpp
@@ -695,7 +695,12 @@ bool FakeVimHandler::Private::handleCommandMode(int key, const QString &text)
         else
             moveToFirstNonBlankOnLine();
     } else if (key == 'j' || key == Key_Down) {
-        m_tc.movePosition(Down, KeepAnchor, count());
+        if (m_submode == NoSubMode || m_submode == ZSubMode || m_submode == RegisterSubMode) {
+            m_tc.movePosition(Down, KeepAnchor, count());
+        } else {
+            m_tc.movePosition(StartOfLine, MoveAnchor);
+            m_tc.movePosition(Down, KeepAnchor, count()+1);
+        }
         finishMovement();
     } else if (key == 'J') {
         EditOperation op;
@@ -710,7 +715,13 @@ bool FakeVimHandler::Private::handleCommandMode(int key, const QString &text)
                 m_tc.movePosition(Left, MoveAnchor, 1);
         }
     } else if (key == 'k' || key == Key_Up) {
-        m_tc.movePosition(Up, KeepAnchor, count());
+        if (m_submode == NoSubMode || m_submode == ZSubMode || m_submode == RegisterSubMode) {
+            m_tc.movePosition(Up, KeepAnchor, count());
+        } else {
+            m_tc.movePosition(StartOfLine, MoveAnchor);
+            m_tc.movePosition(Down, MoveAnchor);
+            m_tc.movePosition(Up, KeepAnchor, count()+1);
+        }
         finishMovement();
     } else if (key == 'l' || key == Key_Right) {
         m_tc.movePosition(Right, KeepAnchor, qMin(count(), rightDist()));
-- 
GitLab