FakeVim: Fix how block selection is represented in editor widget

Change-Id: I717276610b6d403d6304bc15dba07d170da0d549
Reviewed-by: hjk <hjk121@nokiamail.com>
This commit is contained in:
hluk
2013-06-16 18:14:36 +02:00
committed by hjk
parent 8180f695f1
commit ab41da6a14

View File

@@ -2239,18 +2239,17 @@ void FakeVimHandler::Private::exportSelection()
m_oldInternalAnchor = anc;
if (isVisualMode()) {
bool visualBlockInverted;
if (m_visualMode == VisualBlockMode) {
const int col1 = anc - document()->findBlock(anc).position();
const int col2 = pos - document()->findBlock(pos).position();
visualBlockInverted = col1 > col2;
} else {
visualBlockInverted = anc > pos;
if (col1 > col2)
++anc;
else
++pos;
} else if (anc > pos) {
++anc;
}
if (visualBlockInverted)
setAnchorAndPosition(anc + 1, pos);
else
setAnchorAndPosition(anc, pos);
setAnchorAndPosition(anc, pos);
if (m_visualMode == VisualBlockMode) {
commitCursor();