forked from qt-creator/qt-creator
FakeVim: Fix how block selection is represented in editor widget
Change-Id: I717276610b6d403d6304bc15dba07d170da0d549 Reviewed-by: hjk <hjk121@nokiamail.com>
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user