]> git.notmuchmail.org Git - notmuch/blobdiff - vim/plugin/notmuch.vim
vim: store previous buffer number when starting to compose
[notmuch] / vim / plugin / notmuch.vim
index 0adca0b0c574922ec78a90a1e14a74d4a8b9105b..63a711fdf84368af8b1300e6d3367fdfaa026f61 100644 (file)
@@ -886,7 +886,7 @@ function! s:NM_cmd_compose(words, body_lines)
 
         let hdrs = { }
         for word in a:words
-                let m = matchlist(word, '^\([^:]\+\):\s*\(.*\)\s*$')
+                let m = matchlist(word, '^\(\w[^:]*\):\s*\(.*\)\s*$')
                 if !len(m)
                         throw 'Eeek! bad parameter ''' . string(word) . ''''
                 endif
@@ -936,6 +936,7 @@ function! s:NM_cmd_compose(words, body_lines)
         call <SID>NM_newFileBuffer(g:notmuch_compose_temp_file_dir, '%s.mail',
                                   \ 'compose', lines)
         setlocal bufhidden=hide
+        let b:nm_prev_bufnr = prev_bufnr
 
         call <SID>NM_set_map('n', g:notmuch_compose_nmaps)
         call <SID>NM_set_map('i', g:notmuch_compose_imaps)