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,17 +2239,16 @@ void FakeVimHandler::Private::exportSelection()
|
|||||||
m_oldInternalAnchor = anc;
|
m_oldInternalAnchor = anc;
|
||||||
|
|
||||||
if (isVisualMode()) {
|
if (isVisualMode()) {
|
||||||
bool visualBlockInverted;
|
|
||||||
if (m_visualMode == VisualBlockMode) {
|
if (m_visualMode == VisualBlockMode) {
|
||||||
const int col1 = anc - document()->findBlock(anc).position();
|
const int col1 = anc - document()->findBlock(anc).position();
|
||||||
const int col2 = pos - document()->findBlock(pos).position();
|
const int col2 = pos - document()->findBlock(pos).position();
|
||||||
visualBlockInverted = col1 > col2;
|
if (col1 > col2)
|
||||||
} else {
|
++anc;
|
||||||
visualBlockInverted = anc > pos;
|
|
||||||
}
|
|
||||||
if (visualBlockInverted)
|
|
||||||
setAnchorAndPosition(anc + 1, pos);
|
|
||||||
else
|
else
|
||||||
|
++pos;
|
||||||
|
} else if (anc > pos) {
|
||||||
|
++anc;
|
||||||
|
}
|
||||||
setAnchorAndPosition(anc, pos);
|
setAnchorAndPosition(anc, pos);
|
||||||
|
|
||||||
if (m_visualMode == VisualBlockMode) {
|
if (m_visualMode == VisualBlockMode) {
|
||||||
|
|||||||
Reference in New Issue
Block a user