forked from qt-creator/qt-creator
implement 'M' in fakevim
This commit is contained in:
@@ -287,8 +287,7 @@ void FakeVimHandler::Private::handleCommandMode(int key, const QString &text)
|
|||||||
m_tc.movePosition(Left, KeepAnchor, n);
|
m_tc.movePosition(Left, KeepAnchor, n);
|
||||||
finishMovement();
|
finishMovement();
|
||||||
} else if (key == 'H') {
|
} else if (key == 'H') {
|
||||||
int firstPos = m_editor->cursorForPosition(QPoint(0, 0)).position();
|
m_tc = m_editor->cursorForPosition(QPoint(0, 0));
|
||||||
m_tc.setPosition(firstPos, KeepAnchor);
|
|
||||||
m_tc.movePosition(Down, KeepAnchor, qMax(count() - 1, 0));
|
m_tc.movePosition(Down, KeepAnchor, qMax(count() - 1, 0));
|
||||||
moveToFirstNonBlankOnLine();
|
moveToFirstNonBlankOnLine();
|
||||||
finishMovement();
|
finishMovement();
|
||||||
@@ -304,12 +303,17 @@ void FakeVimHandler::Private::handleCommandMode(int key, const QString &text)
|
|||||||
m_tc.movePosition(Right, KeepAnchor, qMin(count(), rightDist()));
|
m_tc.movePosition(Right, KeepAnchor, qMin(count(), rightDist()));
|
||||||
finishMovement();
|
finishMovement();
|
||||||
} else if (key == 'L') {
|
} else if (key == 'L') {
|
||||||
QPoint point = m_editor->geometry().bottomRight();
|
int heigth = m_editor->height();
|
||||||
int firstPos = m_editor->cursorForPosition(point).position();
|
m_tc = m_editor->cursorForPosition(QPoint(0, heigth));
|
||||||
m_tc.setPosition(firstPos, KeepAnchor);
|
m_tc.movePosition(Up, KeepAnchor, qMax(count() - 1, 0));
|
||||||
m_tc.movePosition(Up, KeepAnchor, qMax(count(), 1));
|
m_tc.movePosition(Up, KeepAnchor, qMax(count(), 1));
|
||||||
moveToFirstNonBlankOnLine();
|
moveToFirstNonBlankOnLine();
|
||||||
finishMovement();
|
finishMovement();
|
||||||
|
} else if (key == 'M') {
|
||||||
|
int heigth = m_editor->height();
|
||||||
|
m_tc = m_editor->cursorForPosition(QPoint(0, heigth / 2));
|
||||||
|
moveToFirstNonBlankOnLine();
|
||||||
|
finishMovement();
|
||||||
} else if (key == 'n') {
|
} else if (key == 'n') {
|
||||||
search(m_lastSearchString, m_lastSearchBackward);
|
search(m_lastSearchString, m_lastSearchBackward);
|
||||||
} else if (key == 'N') {
|
} else if (key == 'N') {
|
||||||
|
|||||||
Reference in New Issue
Block a user