diff --git a/plugin/magit.vim b/plugin/magit.vim index 14553825d6c802f09a85d42bcf8e895a255b8f5b..8028b601e4fb88d536821f26ce159a82e01d31d6 100644 --- a/plugin/magit.vim +++ b/plugin/magit.vim @@ -232,16 +232,15 @@ function! s:mg_get_commit_section() " refresh the COMMIT_EDITMSG file if ( b:magit_current_commit_mode == 'CC' ) silent! call magit#sys#system_noraise("GIT_EDITOR=/bin/false " . - \ g:magit_git_cmd . " -c commit.verbose=no commit -e 2> /dev/null") + \ g:magit_git_cmd . " -c commit.verbose=no commit --cleanup=verbatim --no-status -e 2> /dev/null") elseif ( b:magit_current_commit_mode == 'CA' ) silent! call magit#sys#system_noraise("GIT_EDITOR=/bin/false " . - \ g:magit_git_cmd . " -c commit.verbose=no commit --amend -e 2> /dev/null") + \ g:magit_git_cmd . " -c commit.verbose=no commit --cleanup=verbatim --no-status --amend -e 2> /dev/null") endif if ( !empty(b:magit_current_commit_msg) ) silent put =b:magit_current_commit_msg elseif ( filereadable(git_dir . 'COMMIT_EDITMSG') ) - let comment_char=magit#git#get_config("core.commentChar", '#') - let commit_msg=magit#utils#join_list(filter(readfile(git_dir . 'COMMIT_EDITMSG'), 'v:val !~ "^' . comment_char . '"')) + let commit_msg=readfile(git_dir . 'COMMIT_EDITMSG') silent put =commit_msg endif silent put ='' diff --git a/syntax/magit.vim b/syntax/magit.vim index 6225e8765c18dee7612a34798f5bdcd7c2d26e5c..3726ead52f7064d1808e179b696b550797dc6e9c 100644 --- a/syntax/magit.vim +++ b/syntax/magit.vim @@ -15,7 +15,9 @@ hi def link titleEntry Comment execute 'syn region commitMsg start=/' . g:magit_sections.commit . '/ end=/\%(' . g:magit_section_re . '\)\@=/ contains=titleEntry' execute 'syn match commitMsgExceed "\%(=\+\n\+\_^.\{' . g:magit_commit_title_limit . '}\)\@<=.*$" contained containedin=commitMsg' +execute 'syn match commitMsgComment "^\s*#.*$" contained containedin=commitMsg' hi def link commitMsgExceed Comment +hi def link commitMsgComment Comment execute 'syn match stashEntry "' . g:magit_stash_re . '"' hi def link stashEntry String