Skip to content

Commit

Permalink
plugin/magit.vim: fix warning when magit is closed with bdelete
Browse files Browse the repository at this point in the history
fix #130
  • Loading branch information
jreybert committed May 23, 2017
1 parent 95f8ad7 commit 2bdd7cd
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions plugin/magit.vim
Original file line number Diff line number Diff line change
Expand Up @@ -765,8 +765,16 @@ function! magit#show_magit(display, ...)
" let magit buffer in read mode when cursor is not in file, to avoid
" unfortunate commit with a :wall command out of magit buffer if a commit
" message is ongoing
execute "autocmd BufEnter " . buffer_name . " :if ( b:magit_current_commit_mode != '' ) | call s:set_mode_write() | endif"
execute "autocmd BufLeave " . buffer_name . " :if ( b:magit_current_commit_mode != '' ) | call s:set_mode_read() | endif"
execute "autocmd BufEnter " . buffer_name . "
\ :if ( exists('b:magit_current_commit_mode') &&
\ b:magit_current_commit_mode != '' ) |
\ call s:set_mode_write() |
\ endif"
execute "autocmd BufLeave " . buffer_name . "
\ :if ( exists('b:magit_current_commit_mode') &&
\ b:magit_current_commit_mode != '' ) |
\ call s:set_mode_read() |
\ endif"

let b:state = deepcopy(g:magit#state#state)
" s:magit_commit_mode: global variable which states in which commit mode we are
Expand Down

0 comments on commit 2bdd7cd

Please sign in to comment.