Commit 6547845d authored by Lukas Holecek's avatar Lukas Holecek Committed by hjk

fakevim: Fix movement with '%'

Change-Id: I6c4bf3b39b334ae621e4648bbc57f50ba8d418ec
Reviewed-by: default avatarhjk <qthjk@ovi.com>
parent 6e5018ef
......@@ -3012,13 +3012,15 @@ bool FakeVimHandler::Private::handleMovement(const Input &input)
movement = "$";
} else if (input.is('%')) {
recordJump();
if (count == 1) {
if (m_mvcount.isEmpty()) {
moveToMatchingParanthesis();
m_movetype = MoveInclusive;
} else {
// set cursor position in percentage - formula taken from Vim help
setPosition(firstPositionInLine((count * linesInDocument() + 99) / 100));
moveToTargetColumn();
handleStartOfLine();
m_movetype = MoveLineWise;
}
} else if (input.is('b') || input.isShift(Key_Left)) {
m_movetype = MoveExclusive;
......
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