lib/vmail.vim in vmail-1.4.9 vs lib/vmail.vim in vmail-1.5.0
- old
+ new
@@ -572,21 +572,22 @@
redraw
echo a:command
let res = system(a:command)
split compose_message.txt
setlocal modifiable
+ " TODO maybe later save backups?
+ setlocal buftype=nowrite
if winnr('$') > 1
wincmd p
close!
endif
silent 1,$delete
silent put! =res
call feedkeys("\<cr>")
call s:compose_window_mappings()
setlocal completefunc=CompleteContact
normal 1G
- write!
endfunc
func! s:turn_into_compose_window()
call s:compose_window_mappings()
setlocal completefunc=CompleteContact
@@ -627,14 +628,15 @@
function! s:send_message()
let mail = join(getline(1,'$'), "\n")
echo "Sending message"
- call system(s:deliver_command, mail)
+ let res = system(s:deliver_command, mail)
+ if match(res, '^Failed') == -1
+ call s:close_and_focus_list_window()
+ endif
redraw
- call s:close_and_focus_list_window()
- redraw
- echom "Message sent!"
+ echom substitute(res, '[\s\r\n]\+$', '', '')
endfunction
" --------------------------------------------------------------------------------
" call from inside message window with <Leader>h