Commit d4576a4b authored by Lukas Holecek's avatar Lukas Holecek Committed by hjk
Browse files

fakevim: Fix block selections



Selection anchor should be in front text cursor position.

Last block with nested block should be selected properly.

Change-Id: I796875ef7bce3527fb703ece5fdf944123f12315
Reviewed-by: default avatarhjk <qthjk@ovi.com>
parent ead1ea24
......@@ -4853,7 +4853,8 @@ int FakeVimHandler::Private::blockBoundary(const QString &left,
tc1 = document()->find(begin, tc1, flags);
}
while (level > 0 && (closing ? (tc2 < tc1) : (tc1 < tc2))) {
while (level > 0
&& (tc1.isNull() || (closing ? (tc2 < tc1) : (tc1 < tc2)))) {
--level;
tc2 = document()->find(end, tc2, flags);
if (tc2.isNull())
......@@ -5158,7 +5159,7 @@ void FakeVimHandler::Private::selectBlockTextObject(bool inner,
p2 -= sright.size() - 1;
}
setAnchorAndPosition(p2, p1);
setAnchorAndPosition(p1, p2);
m_movetype = MoveInclusive;
}
......
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