From 1c3d2c35d5510c1ba6e1bc2593dce9cb4093a0b4 Mon Sep 17 00:00:00 2001
From: hjk <qtc-committer@nokia.com>
Date: Thu, 19 Mar 2009 11:58:59 +0100
Subject: [PATCH] fakevim: implement 'c' in (character) visual mode

---
 src/plugins/fakevim/fakevimhandler.cpp | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/src/plugins/fakevim/fakevimhandler.cpp b/src/plugins/fakevim/fakevimhandler.cpp
index 9f25943705f..62f56238f47 100644
--- a/src/plugins/fakevim/fakevimhandler.cpp
+++ b/src/plugins/fakevim/fakevimhandler.cpp
@@ -1034,10 +1034,15 @@ EventResult FakeVimHandler::Private::handleCommandMode(int key, int unmodified,
         m_moveType = MoveExclusive;
         moveToWordBoundary(true, false);
         finishMovement();
-    } else if (key == 'c') {
+    } else if (key == 'c' && m_visualMode == NoVisualMode) {
         setAnchor();
         recordBeginGroup();
         m_submode = ChangeSubMode;
+    } else if (key == 'c' && m_visualMode == VisualCharMode) { 
+        recordBeginGroup();
+        leaveVisualMode();
+        m_submode = ChangeSubMode;
+        finishMovement();
     } else if (key == 'C') {
         setAnchor();
         recordBeginGroup();
@@ -1053,12 +1058,12 @@ EventResult FakeVimHandler::Private::handleCommandMode(int key, int unmodified,
         m_opcount = m_mvcount;
         m_mvcount.clear();
         m_submode = DeleteSubMode;
-   } else if ((key == 'd' || key == 'x') && m_visualMode == VisualCharMode) { 
+    } else if ((key == 'd' || key == 'x') && m_visualMode == VisualCharMode) { 
         recordBeginGroup();
         leaveVisualMode();
         m_submode = DeleteSubMode;
         finishMovement();
-   } else if ((key == 'd' || key == 'x') && m_visualMode == VisualLineMode) {
+    } else if ((key == 'd' || key == 'x') && m_visualMode == VisualLineMode) {
         leaveVisualMode();
         int beginLine = lineForPosition(m_marks['<']);
         int endLine = lineForPosition(m_marks['>']);
-- 
GitLab