From 6d03617cce78f1b5371da1ccc9ba9397a677aaad Mon Sep 17 00:00:00 2001
From: hjk <qtc-committer@nokia.com>
Date: Sun, 28 Dec 2008 02:49:14 +0100
Subject: [PATCH] implement 'I' and 'gI'

---
 src/plugins/fakevim/handler.cpp | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/plugins/fakevim/handler.cpp b/src/plugins/fakevim/handler.cpp
index 77d691ca8b1..a50105fdf2d 100644
--- a/src/plugins/fakevim/handler.cpp
+++ b/src/plugins/fakevim/handler.cpp
@@ -350,7 +350,7 @@ void FakeVimHandler::Private::handleCommandMode(int key, const QString &text)
         finishMovement();
     } else if (key >= '0' && key <= '9') {
         if (key == '0' && m_mvcount.isEmpty()) {
-            m_tc.movePosition(StartOfLine, KeepAnchor);
+            moveToFirstNonBlankOnLine();
             finishMovement();
         } else {
             m_mvcount.append(QChar(key));
@@ -450,7 +450,10 @@ void FakeVimHandler::Private::handleCommandMode(int key, const QString &text)
         m_lastInsertion.clear();
     } else if (key == 'I') {
         m_mode = InsertMode;
-        moveToFirstNonBlankOnLine();
+        if (m_gflag)
+            m_tc.movePosition(StartOfLine, KeepAnchor);
+        else
+            moveToFirstNonBlankOnLine();
         m_tc.clearSelection();
         m_tc.beginEditBlock();
         m_lastInsertion.clear();
-- 
GitLab