From 0a665de576e2a4da2ff47ebe10e58295ec574cd1 Mon Sep 17 00:00:00 2001
From: hjk <qtc-committer@nokia.com>
Date: Thu, 25 Dec 2008 23:19:08 +0100
Subject: [PATCH] initialize commandCode

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

diff --git a/src/plugins/fakevim/handler.cpp b/src/plugins/fakevim/handler.cpp
index dbb9cc3f6b7..e1540c9f511 100644
--- a/src/plugins/fakevim/handler.cpp
+++ b/src/plugins/fakevim/handler.cpp
@@ -153,6 +153,7 @@ FakeVimHandler::Private::Private(FakeVimHandler *parent)
 {
     q = parent;
     m_mode = CommandMode;
+    m_commandCode = 0;
     m_fakeEnd = false;
     m_lastSearchBackward = false;
     m_register = '"';
@@ -240,7 +241,6 @@ void FakeVimHandler::Private::finishMovement()
 
 void FakeVimHandler::Private::updateCommandBuffer()
 {
-    //qDebug() << "CMD" << m_commandBuffer;
     QString msg = QChar(m_commandCode ? m_commandCode : ' ') + m_commandBuffer;
     emit q->commandBufferChanged(msg);
 }
@@ -605,9 +605,10 @@ void FakeVimHandler::Private::moveToNextWord(int repeat, bool simple)
     // FIXME: 'w' should stop on empty lines, too
     QTextDocument *doc = m_tc.document();
     int n = lastPositionInDocument() - 1;
-    int lastClass = 0;
+    QChar c = doc->characterAt(m_tc.position());
+    int lastClass = charClass(c, simple);
     while (true) {
-        QChar c = doc->characterAt(m_tc.position());
+        c = doc->characterAt(m_tc.position());
         int thisClass = charClass(c, simple);
         if (thisClass != lastClass && thisClass != 0)
             --repeat;
-- 
GitLab