forked from qt-creator/qt-creator
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: hjk <qthjk@ovi.com>
This commit is contained in:
@@ -4853,7 +4853,8 @@ int FakeVimHandler::Private::blockBoundary(const QString &left,
|
|||||||
tc1 = document()->find(begin, tc1, flags);
|
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;
|
--level;
|
||||||
tc2 = document()->find(end, tc2, flags);
|
tc2 = document()->find(end, tc2, flags);
|
||||||
if (tc2.isNull())
|
if (tc2.isNull())
|
||||||
@@ -5158,7 +5159,7 @@ void FakeVimHandler::Private::selectBlockTextObject(bool inner,
|
|||||||
p2 -= sright.size() - 1;
|
p2 -= sright.size() - 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
setAnchorAndPosition(p2, p1);
|
setAnchorAndPosition(p1, p2);
|
||||||
m_movetype = MoveInclusive;
|
m_movetype = MoveInclusive;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user