forked from qt-creator/qt-creator
fakevim: fix backward deletion/change
This commit is contained in:
@@ -528,6 +528,8 @@ void FakeVimHandler::Private::finishMovement(const QString &dotCommand)
|
|||||||
if (m_submode == ChangeSubMode) {
|
if (m_submode == ChangeSubMode) {
|
||||||
if (m_moveType == MoveInclusive)
|
if (m_moveType == MoveInclusive)
|
||||||
moveRight(); // correction
|
moveRight(); // correction
|
||||||
|
if (anchor() >= position())
|
||||||
|
m_anchor++;
|
||||||
if (!dotCommand.isEmpty())
|
if (!dotCommand.isEmpty())
|
||||||
m_dotCommand = "c" + dotCommand;
|
m_dotCommand = "c" + dotCommand;
|
||||||
QString text = recordRemoveSelectedText();
|
QString text = recordRemoveSelectedText();
|
||||||
@@ -538,6 +540,8 @@ void FakeVimHandler::Private::finishMovement(const QString &dotCommand)
|
|||||||
} else if (m_submode == DeleteSubMode) {
|
} else if (m_submode == DeleteSubMode) {
|
||||||
if (m_moveType == MoveInclusive)
|
if (m_moveType == MoveInclusive)
|
||||||
moveRight(); // correction
|
moveRight(); // correction
|
||||||
|
if (anchor() >= position())
|
||||||
|
m_anchor++;
|
||||||
if (!dotCommand.isEmpty())
|
if (!dotCommand.isEmpty())
|
||||||
m_dotCommand = "d" + dotCommand;
|
m_dotCommand = "d" + dotCommand;
|
||||||
m_registers[m_register] = recordRemoveSelectedText();
|
m_registers[m_register] = recordRemoveSelectedText();
|
||||||
@@ -892,6 +896,7 @@ bool FakeVimHandler::Private::handleCommandMode(int key, int unmodified,
|
|||||||
} else if (key == '=') {
|
} else if (key == '=') {
|
||||||
m_submode = IndentSubMode;
|
m_submode = IndentSubMode;
|
||||||
} else if (key == '%') {
|
} else if (key == '%') {
|
||||||
|
m_moveType = MoveExclusive;
|
||||||
moveToMatchingParanthesis();
|
moveToMatchingParanthesis();
|
||||||
finishMovement();
|
finishMovement();
|
||||||
} else if (key == 'a') {
|
} else if (key == 'a') {
|
||||||
|
Reference in New Issue
Block a user