Skip to content
Snippets Groups Projects
Commit f4b2053f authored by NTCong's avatar NTCong Committed by Jerome Reybert
Browse files

only set autocmd once for write command checking

parent 42b014bd
No related branches found
No related tags found
No related merge requests found
...@@ -807,6 +807,8 @@ function! magit#show_magit(display, ...) ...@@ -807,6 +807,8 @@ function! magit#show_magit(display, ...)
let &l:foldlevel = b:magit_default_fold_level let &l:foldlevel = b:magit_default_fold_level
setlocal filetype=magit setlocal filetype=magit
augroup vimagit_buffer
autocmd!
" catch write command " catch write command
execute "autocmd BufWriteCmd " . buffer_name . " :call magit#commit_command('CC')" execute "autocmd BufWriteCmd " . buffer_name . " :call magit#commit_command('CC')"
...@@ -823,6 +825,7 @@ function! magit#show_magit(display, ...) ...@@ -823,6 +825,7 @@ function! magit#show_magit(display, ...)
\ b:magit_current_commit_mode != '' ) | \ b:magit_current_commit_mode != '' ) |
\ call s:set_mode_read() | \ call s:set_mode_read() |
\ endif" \ endif"
augroup END
let b:state = deepcopy(g:magit#state#state) let b:state = deepcopy(g:magit#state#state)
" s:magit_commit_mode: global variable which states in which commit mode we are " s:magit_commit_mode: global variable which states in which commit mode we are
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment