Browse Source

vim-mode: reset to Normal mode when edit begins

Le Tan 8 years ago
parent
commit
b7f2690e96
2 changed files with 4 additions and 0 deletions
  1. 1 0
      src/utils/vvim.cpp
  2. 3 0
      src/veditoperations.cpp

+ 1 - 0
src/utils/vvim.cpp

@@ -595,6 +595,7 @@ VimMode VVim::getMode() const
 void VVim::setMode(VimMode p_mode)
 {
     if (m_mode != p_mode) {
+        clearSelection();
         m_mode = p_mode;
         resetState();
 

+ 3 - 0
src/veditoperations.cpp

@@ -65,6 +65,9 @@ void VEditOperations::updateCursorLineBg()
 
 void VEditOperations::handleEditConfigUpdated()
 {
+    // Reset to Normal mode.
+    m_vim->setMode(VimMode::Normal);
+
     updateCursorLineBg();
 }