mirror of
https://git.notmuchmail.org/git/notmuch
synced 2024-12-24 18:34:52 +01:00
vim: parse 'from' address
In order to pass it to sendmail. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
This commit is contained in:
parent
e7899b00d0
commit
81347e289f
1 changed files with 10 additions and 1 deletions
|
@ -962,7 +962,16 @@ function! s:NM_compose_send()
|
|||
exec printf(':0,%dd', hdr_starts)
|
||||
write
|
||||
|
||||
let cmdtxt = g:notmuch_sendmail . ' -t < ' . fname
|
||||
let line = getline(1)
|
||||
let m = matchlist(line, '^From:\s*\(.*\)\s*<\(.*\)>$')
|
||||
if (len(m) >= 2)
|
||||
let from = m[2]
|
||||
else
|
||||
let m = matchlist(line, '^From:\s*\(.*\)$')
|
||||
let from = m[1]
|
||||
endif
|
||||
|
||||
let cmdtxt = g:notmuch_sendmail . ' -t -f ' . from . ' < ' . fname
|
||||
let out = system(cmdtxt)
|
||||
let err = v:shell_error
|
||||
if err
|
||||
|
|
Loading…
Reference in a new issue