forked from qt-creator/qt-creator
fakevim: implement 'gg' for moving to first line
This commit is contained in:
@@ -951,7 +951,15 @@ bool FakeVimHandler::Private::handleCommandMode(int key, int unmodified,
|
|||||||
m_subsubmode = FtSubSubMode;
|
m_subsubmode = FtSubSubMode;
|
||||||
m_subsubdata = key;
|
m_subsubdata = key;
|
||||||
} else if (key == 'g') {
|
} else if (key == 'g') {
|
||||||
|
if (m_gflag) {
|
||||||
|
m_gflag = false;
|
||||||
|
m_tc.setPosition(firstPositionInLine(1), KeepAnchor);
|
||||||
|
if (m_config[ConfigStartOfLine] == ConfigOn)
|
||||||
|
moveToFirstNonBlankOnLine();
|
||||||
|
finishMovement();
|
||||||
|
} else {
|
||||||
m_gflag = true;
|
m_gflag = true;
|
||||||
|
}
|
||||||
} else if (key == 'G') {
|
} else if (key == 'G') {
|
||||||
int n = m_mvcount.isEmpty() ? linesInDocument() : count();
|
int n = m_mvcount.isEmpty() ? linesInDocument() : count();
|
||||||
m_tc.setPosition(firstPositionInLine(n), KeepAnchor);
|
m_tc.setPosition(firstPositionInLine(n), KeepAnchor);
|
||||||
|
|||||||
Reference in New Issue
Block a user