]> git.notmuchmail.org Git - notmuch/blobdiff - vim/plugin/notmuch.vim
vim: don't remove headers until after parsing them
[notmuch] / vim / plugin / notmuch.vim
index a4d04e26104ee4da4358cc06bea8e35689c52752..f32a134f01cd18261739fa547f0cf33c91b9d862 100644 (file)
@@ -939,8 +939,6 @@ function! s:NM_compose_send()
                 let line = getline(lnum)
         endwhile
         let body_starts = lnum
-        exec printf('0,%dd', body_starts)
-        write
 
         "[-a header] [-b bcc-addr] [-c cc-addr] [-s subject] to-addr
         let cmd = ['mail']
@@ -972,6 +970,12 @@ function! s:NM_compose_send()
         endfor
         call extend(cmd, tos)
 
+        " TODO: make sure we have at least one target
+        " TODO: ask about empty jubject, etc
+
+        exec printf('0,%dd', body_starts)
+        write
+
         call map(cmd, 's:NM_shell_escape(v:val)')
         let cmdtxt = join(cmd) . '< ' . fname
         let out = system(cmdtxt)