summaryrefslogtreecommitdiffstats
path: root/.vim/ftplugin/mail.vim
blob: 8fcbb5e4585cb5dc8e8639c0cfba3ce6f539847e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
if exists("b:loaded_Mail_plugin")
	finish
endif
let b:loaded_Mail_plugin = 1

function MailGetRecipient()
	let savedpos = getpos('.')
	call setpos('.', [0, 1, 1, 0])
	let line = getline(search("^To:"))
	let linesplit = split(line)
	call setpos('.', savedpos)

	if len(linesplit) > 1
		let elements = linesplit[1:-1]
		if len(elements) > 1
			return elements
		else
			return elements[0:0] +  [""]
		endif
	else
		return ["", ""]
	endif
endfu