diff --git a/src/plugins/fakevim/fakevimhandler.cpp b/src/plugins/fakevim/fakevimhandler.cpp index 0d88f5a2991..d3d0586c03c 100755 --- a/src/plugins/fakevim/fakevimhandler.cpp +++ b/src/plugins/fakevim/fakevimhandler.cpp @@ -1384,7 +1384,8 @@ EventResult FakeVimHandler::Private::handleCommandMode(int key, int unmodified, } else if (key == 'g') { if (m_gflag) { m_gflag = false; - m_tc.setPosition(firstPositionInLine(1), KeepAnchor); + int n = m_mvcount.isEmpty() ? 1 : count(); + m_tc.setPosition(firstPositionInLine(n), KeepAnchor); handleStartOfLine(); finishMovement(); } else {