[gnome-builder/wip/operators: 2/4] source-vim: Make cw behaves like ce



commit 32572fa396a11a9cc34e16206154427c91267e35
Author: Carlos Soriano <csoriano gnome org>
Date:   Fri Jan 30 15:50:23 2015 +0100

    source-vim: Make cw behaves like ce
    
    It is more convenient since when we want to change a word we want
    to substitute that word, not that word plus the spaces after it.
    
    It is how Vim behaves.

 src/vim/gb-source-vim.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
---
diff --git a/src/vim/gb-source-vim.c b/src/vim/gb-source-vim.c
index cf7bbfc..0c992cb 100644
--- a/src/vim/gb-source-vim.c
+++ b/src/vim/gb-source-vim.c
@@ -4747,6 +4747,9 @@ gb_source_vim_cmd_change (GbSourceVim *vim,
     }
   else if (modifier != 'd')
     {
+      /* In Vim changing a word (cw) behaves like changing to end (ce) */
+      if (modifier == 'w')
+        modifier = 'e';
       /* cd should do nothing */
       gb_source_vim_cmd_delete (vim, count, modifier);
       gb_source_vim_set_mode (vim, GB_SOURCE_VIM_INSERT);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]