diff --git a/src/plugins/fakevim/fakevimhandler.cpp b/src/plugins/fakevim/fakevimhandler.cpp index 49c95091ba4..fa637b44e8b 100644 --- a/src/plugins/fakevim/fakevimhandler.cpp +++ b/src/plugins/fakevim/fakevimhandler.cpp @@ -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();