Commit 65c5a84e authored by hjk's avatar hjk
Browse files

fakevim: fix anchor setting after %

parent 6c5aa480
......@@ -2048,7 +2048,6 @@ EventResult FakeVimHandler::Private::handleCommandMode(const Input &input)
endEditBlock();
leaveVisualMode();
} else if (input.is('%')) {
setAnchor();
moveToMatchingParanthesis();
finishMovement();
} else if ((!isVisualMode() && input.is('a')) || (isVisualMode() && input.is('A'))) {
......@@ -3994,11 +3993,12 @@ void FakeVimHandler::Private::moveToMatchingParanthesis()
bool moved = false;
bool forward = false;
const int anc = anchor();
QTextCursor tc = cursor();
emit q->moveToMatchingParenthesis(&moved, &forward, &tc);
if (moved && forward)
tc.movePosition(Left, KeepAnchor, 1);
setCursor(tc);
setAnchorAndPosition(anc, tc.position());
setTargetColumn();
}
......
Supports Markdown
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