Commit 6f581240 authored by hjk's avatar hjk
Browse files

fakevim: fix mark positions after <Delete>

(cherry picked from commit 7ccf903ee3d9da4a104310ed423130857d59d91b)
parent 312509fc
......@@ -2035,22 +2035,25 @@ EventResult FakeVimHandler::Private::handleCommandMode(const Input &input)
m_opcount = m_mvcount;
m_mvcount.clear();
m_submode = DeleteSubMode;
} else if ((input.is('d') || input.is('x')) && isVisualCharMode()) {
leaveVisualMode();
m_submode = DeleteSubMode;
finishMovement();
} else if ((input.is('d') || input.is('x')) && isVisualLineMode()) {
leaveVisualMode();
m_rangemode = RangeLineMode;
yankText(currentRange(), m_register);
removeText(currentRange());
handleStartOfLine();
} else if ((input.is('d') || input.is('x')) && isVisualBlockMode()) {
leaveVisualMode();
m_rangemode = RangeBlockMode;
yankText(currentRange(), m_register);
removeText(currentRange());
setPosition(qMin(position(), anchor()));
} else if ((input.is('d') || input.is('x') || input.isKey(Key_Delete))
&& isVisualMode()) {
if (isVisualCharMode()) {
leaveVisualMode();
m_submode = DeleteSubMode;
finishMovement();
} else if (isVisualLineMode()) {
leaveVisualMode();
m_rangemode = RangeLineMode;
yankText(currentRange(), m_register);
removeText(currentRange());
handleStartOfLine();
} else if (isVisualBlockMode()) {
leaveVisualMode();
m_rangemode = RangeBlockMode;
yankText(currentRange(), m_register);
removeText(currentRange());
setPosition(qMin(position(), anchor()));
}
} else if (input.is('D') && isNoVisualMode()) {
if (atEndOfLine())
moveLeft();
......@@ -2486,6 +2489,8 @@ EventResult FakeVimHandler::Private::handleCommandMode(const Input &input)
setAnchor();
moveRight(qMin(1, rightDist()));
removeText(currentRange());
if (atEndOfLine())
moveLeft();
} else if (input.isKey(Key_BracketLeft) || input.isKey(Key_BracketRight)) {
} else if (input.isControl(Key_BracketRight)) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment