vim: check compose is done on delete
authorFelipe Contreras <felipe.contreras@gmail.com>
Sat, 2 Nov 2013 10:40:01 +0000 (04:40 -0600)
committerFelipe Contreras <felipe.contreras@gmail.com>
Wed, 20 Nov 2013 13:23:30 +0000 (07:23 -0600)
Not on unload, which happens when we switch buffers.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
vim/notmuch.vim

index 9109470a9561eba268dcedc20426b59d9d3611da..d7b310c8a07cfa99afb284a8c8ee99d44d5d5028 100644 (file)
@@ -67,7 +67,7 @@ function! s:new_file_buffer(type, fname)
        ruby $curbuf.init(VIM::evaluate('a:type'))
 endfunction
 
-function! s:compose_unload()
+function! s:on_compose_delete()
        if b:compose_done
                return
        endif
@@ -126,7 +126,7 @@ function! s:show_reply()
        ruby open_reply get_message.mail
        let b:compose_done = 0
        call s:set_map(g:notmuch_compose_maps)
-       autocmd BufUnload <buffer> call s:compose_unload()
+       autocmd BufDelete <buffer> call s:on_compose_delete()
        startinsert!
 endfunction
 
@@ -134,7 +134,7 @@ function! s:compose()
        ruby open_compose
        let b:compose_done = 0
        call s:set_map(g:notmuch_compose_maps)
-       autocmd BufUnload <buffer> call s:compose_unload()
+       autocmd BufDelete <buffer> call s:on_compose_delete()
        startinsert!
 endfunction