forked from qt-creator/qt-creator
FakeVim: Fix Vk command
Fixes visual representation (selection exported to editor widget) of "Vk" command on empty line. Change-Id: Iac5fabe53a65d7b94d0a1ed02aff3a7b3804a37b Reviewed-by: hjk <hjk121@nokiamail.com>
This commit is contained in:
@@ -2273,12 +2273,7 @@ void FakeVimHandler::Private::exportSelection()
|
||||
++anc;
|
||||
else
|
||||
++pos;
|
||||
} else if (anc > pos) {
|
||||
++anc;
|
||||
}
|
||||
setAnchorAndPosition(anc, pos);
|
||||
|
||||
if (g.visualMode == VisualBlockMode) {
|
||||
commitCursor();
|
||||
emit q->requestSetBlockSelection(false);
|
||||
emit q->requestSetBlockSelection(true);
|
||||
@@ -2290,18 +2285,21 @@ void FakeVimHandler::Private::exportSelection()
|
||||
anc = firstPositionInLine(ancLine);
|
||||
} else {
|
||||
pos = firstPositionInLine(posLine);
|
||||
anc = lastPositionInLine(ancLine);
|
||||
anc = lastPositionInLine(ancLine) + 1;
|
||||
}
|
||||
// putting cursor on folded line will unfold the line, so move the cursor a bit
|
||||
if (!document()->findBlock(pos).isVisible())
|
||||
++pos;
|
||||
setAnchorAndPosition(anc, pos);
|
||||
} else if (g.visualMode == VisualCharMode) {
|
||||
/* Nothing */
|
||||
if (anc > pos)
|
||||
++anc;
|
||||
} else {
|
||||
QTC_CHECK(false);
|
||||
}
|
||||
|
||||
setAnchorAndPosition(anc, pos);
|
||||
|
||||
setMark(QLatin1Char('<'), mark(QLatin1Char('<')).position);
|
||||
setMark(QLatin1Char('>'), mark(QLatin1Char('>')).position);
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user