forked from qt-creator/qt-creator
fakevim: fix 'yj', 'dj', 'cj' and 'yk', 'dk', 'ck'
Merge-request: 96 Reviewed-by: hjk <qtc-committer@nokia.com>
This commit is contained in:
@@ -795,6 +795,8 @@ void FakeVimHandler::Private::finishMovement(const QString &dotCommand)
|
|||||||
//qDebug() << "CHANGING TO INSERT MODE" << text;
|
//qDebug() << "CHANGING TO INSERT MODE" << text;
|
||||||
//m_registers[m_register] = text;
|
//m_registers[m_register] = text;
|
||||||
yankSelectedText();
|
yankSelectedText();
|
||||||
|
if (m_movetype == MoveLineWise)
|
||||||
|
m_registers[m_register].rangemode = RangeLineMode;
|
||||||
removeSelectedText();
|
removeSelectedText();
|
||||||
enterInsertMode();
|
enterInsertMode();
|
||||||
m_beginEditBlock = false;
|
m_beginEditBlock = false;
|
||||||
@@ -805,12 +807,15 @@ void FakeVimHandler::Private::finishMovement(const QString &dotCommand)
|
|||||||
if (m_rangemode == RangeCharMode) {
|
if (m_rangemode == RangeCharMode) {
|
||||||
if (m_movetype == MoveInclusive)
|
if (m_movetype == MoveInclusive)
|
||||||
moveRight(); // correction
|
moveRight(); // correction
|
||||||
|
if (m_movetype != MoveLineWise)
|
||||||
if (anchor() >= position())
|
if (anchor() >= position())
|
||||||
m_anchor--;
|
m_anchor--;
|
||||||
}
|
}
|
||||||
if (!dotCommand.isEmpty())
|
if (!dotCommand.isEmpty())
|
||||||
setDotCommand("d" + dotCommand);
|
setDotCommand("d" + dotCommand);
|
||||||
yankSelectedText();
|
yankSelectedText();
|
||||||
|
if (m_movetype == MoveLineWise)
|
||||||
|
m_registers[m_register].rangemode = RangeLineMode;
|
||||||
removeSelectedText();
|
removeSelectedText();
|
||||||
m_submode = NoSubMode;
|
m_submode = NoSubMode;
|
||||||
if (atEndOfLine())
|
if (atEndOfLine())
|
||||||
@@ -819,6 +824,8 @@ void FakeVimHandler::Private::finishMovement(const QString &dotCommand)
|
|||||||
setTargetColumn();
|
setTargetColumn();
|
||||||
} else if (m_submode == YankSubMode) {
|
} else if (m_submode == YankSubMode) {
|
||||||
yankSelectedText();
|
yankSelectedText();
|
||||||
|
if (m_movetype == MoveLineWise)
|
||||||
|
m_registers[m_register].rangemode = RangeLineMode;
|
||||||
m_submode = NoSubMode;
|
m_submode = NoSubMode;
|
||||||
if (m_register != '"') {
|
if (m_register != '"') {
|
||||||
setPosition(m_marks[m_register]);
|
setPosition(m_marks[m_register]);
|
||||||
@@ -1429,6 +1436,7 @@ EventResult FakeVimHandler::Private::handleCommandMode(int key, int unmodified,
|
|||||||
m_movetype = MoveLineWise;
|
m_movetype = MoveLineWise;
|
||||||
moveToStartOfLine();
|
moveToStartOfLine();
|
||||||
setAnchor();
|
setAnchor();
|
||||||
|
m_targetColumn = 0;
|
||||||
moveDown(count() + 1);
|
moveDown(count() + 1);
|
||||||
}
|
}
|
||||||
finishMovement("j");
|
finishMovement("j");
|
||||||
@@ -1462,6 +1470,7 @@ EventResult FakeVimHandler::Private::handleCommandMode(int key, int unmodified,
|
|||||||
} else {
|
} else {
|
||||||
m_movetype = MoveLineWise;
|
m_movetype = MoveLineWise;
|
||||||
moveToStartOfLine();
|
moveToStartOfLine();
|
||||||
|
m_targetColumn = 0;
|
||||||
moveDown();
|
moveDown();
|
||||||
setAnchor();
|
setAnchor();
|
||||||
moveUp(count() + 1);
|
moveUp(count() + 1);
|
||||||
|
Reference in New Issue
Block a user