From 73a5fbcb1c727feef4990c17059fbff6c8244bb1 Mon Sep 17 00:00:00 2001
From: Jerome Reybert <jreybert@gmail.com>
Date: Wed, 11 Nov 2015 22:27:33 +0100
Subject: [PATCH] plugin/magit.vim: disable :w<cr> mapping (fix #41)

This mapping was an awful and error prone solution.

Clean solution is hard to find, and more error prone. It will be re added someday, maybe...
---
 README.md        | 3 ---
 doc/vimagit.txt  | 5 -----
 plugin/magit.vim | 2 --
 3 files changed, 10 deletions(-)

diff --git a/README.md b/README.md
index 0ed444e..f3a9e76 100644
--- a/README.md
+++ b/README.md
@@ -183,9 +183,6 @@ Following mappings are set locally, for magit buffer only, in normal mode.
  * If not in commit section, set commit mode to "New commit" and show "Commit message" section with brand new commit message.
  * If in commit section, commit the all staged changes in commit mode previously set.
 
-##### :w<cr>
- * If in commit section, commit the all staged changes in commit mode previously set.
-
 ##### CA
  * If not in commit section, set commit mode to "Amend commit" and show "Commit message" section with previous commit message.
  * If in commit section, commit the staged changes in commit mode previously set.
diff --git a/doc/vimagit.txt b/doc/vimagit.txt
index 2ee997b..863267e 100644
--- a/doc/vimagit.txt
+++ b/doc/vimagit.txt
@@ -224,11 +224,6 @@ Following mappings are set locally, for magit buffer only, in normal mode.
   CC        If not in commit section, set commit mode to "New commit" and show 
            "Commit message" section with brand new commit message.
             If in commit section, commit the all staged changes in commit mode
-            previously set.
-
-                                    *vimagit-:w<CR>*
-                                    *vimagit-g:magit_commit_mapping_command*
-  :w<CR>    If in commit section, commit the all staged changes in commit mode
             previously set.
 
                                     *vimagit-CA*     *magit#commit_command('CA')*
diff --git a/plugin/magit.vim b/plugin/magit.vim
index 28311d0..3a9dc64 100644
--- a/plugin/magit.vim
+++ b/plugin/magit.vim
@@ -29,7 +29,6 @@ let g:magit_stage_hunk_mapping     = get(g:, 'magit_stage_hunk_mapping',
 let g:magit_stage_line_mapping     = get(g:, 'magit_stage_line_mapping',        'L' )
 let g:magit_mark_line_mapping      = get(g:, 'magit_mark_line_mapping',         'M' )
 let g:magit_discard_hunk_mapping   = get(g:, 'magit_discard_hunk_mapping',      'DDD' )
-let g:magit_commit_mapping_command = get(g:, 'magit_commit_mapping_command',    'w<cr>' )
 let g:magit_commit_mapping         = get(g:, 'magit_commit_mapping',            'CC' )
 let g:magit_commit_amend_mapping   = get(g:, 'magit_commit_amend_mapping',      'CA' )
 let g:magit_commit_fixup_mapping   = get(g:, 'magit_commit_fixup_mapping',      'CF' )
@@ -624,7 +623,6 @@ function! magit#show_magit(display, ...)
 	execute "nnoremap <buffer> <silent> " . g:magit_stage_hunk_mapping .   " :call magit#stage_hunk(0)<cr>"
 	execute "nnoremap <buffer> <silent> " . g:magit_discard_hunk_mapping . " :call magit#stage_hunk(1)<cr>"
 	execute "nnoremap <buffer> <silent> " . g:magit_reload_mapping .       " :call magit#update_buffer()<cr>"
-	execute "cnoremap <buffer> <silent> " . g:magit_commit_mapping_command." :call magit#commit_command('CC')<cr>"
 	execute "nnoremap <buffer> <silent> " . g:magit_commit_mapping .       " :call magit#commit_command('CC')<cr>"
 	execute "nnoremap <buffer> <silent> " . g:magit_commit_amend_mapping . " :call magit#commit_command('CA')<cr>"
 	execute "nnoremap <buffer> <silent> " . g:magit_commit_fixup_mapping . " :call magit#commit_command('CF')<cr>"
-- 
GitLab