From 159e3f613d48ce9b2c1a0c2aba71358b832f0542 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Aum=C3=BCller?= Date: Tue, 5 Jan 2010 18:42:25 +0100 Subject: [PATCH] fakevim: fix 'yj', 'dj', 'cj' and 'yk', 'dk', 'ck' Merge-request: 96 Reviewed-by: hjk --- src/plugins/fakevim/fakevimhandler.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/plugins/fakevim/fakevimhandler.cpp b/src/plugins/fakevim/fakevimhandler.cpp index 4ad404db5fe..0d88f5a2991 100755 --- a/src/plugins/fakevim/fakevimhandler.cpp +++ b/src/plugins/fakevim/fakevimhandler.cpp @@ -795,6 +795,8 @@ void FakeVimHandler::Private::finishMovement(const QString &dotCommand) //qDebug() << "CHANGING TO INSERT MODE" << text; //m_registers[m_register] = text; yankSelectedText(); + if (m_movetype == MoveLineWise) + m_registers[m_register].rangemode = RangeLineMode; removeSelectedText(); enterInsertMode(); m_beginEditBlock = false; @@ -805,12 +807,15 @@ void FakeVimHandler::Private::finishMovement(const QString &dotCommand) if (m_rangemode == RangeCharMode) { if (m_movetype == MoveInclusive) moveRight(); // correction - if (anchor() >= position()) - m_anchor--; + if (m_movetype != MoveLineWise) + if (anchor() >= position()) + m_anchor--; } if (!dotCommand.isEmpty()) setDotCommand("d" + dotCommand); yankSelectedText(); + if (m_movetype == MoveLineWise) + m_registers[m_register].rangemode = RangeLineMode; removeSelectedText(); m_submode = NoSubMode; if (atEndOfLine()) @@ -819,6 +824,8 @@ void FakeVimHandler::Private::finishMovement(const QString &dotCommand) setTargetColumn(); } else if (m_submode == YankSubMode) { yankSelectedText(); + if (m_movetype == MoveLineWise) + m_registers[m_register].rangemode = RangeLineMode; m_submode = NoSubMode; if (m_register != '"') { setPosition(m_marks[m_register]); @@ -1429,6 +1436,7 @@ EventResult FakeVimHandler::Private::handleCommandMode(int key, int unmodified, m_movetype = MoveLineWise; moveToStartOfLine(); setAnchor(); + m_targetColumn = 0; moveDown(count() + 1); } finishMovement("j"); @@ -1462,6 +1470,7 @@ EventResult FakeVimHandler::Private::handleCommandMode(int key, int unmodified, } else { m_movetype = MoveLineWise; moveToStartOfLine(); + m_targetColumn = 0; moveDown(); setAnchor(); moveUp(count() + 1);