aboutsummaryrefslogtreecommitdiff
path: root/vim/autoload/mail/header/field.vim
diff options
context:
space:
mode:
Diffstat (limited to 'vim/autoload/mail/header/field.vim')
-rw-r--r--vim/autoload/mail/header/field.vim6
1 files changed, 6 insertions, 0 deletions
diff --git a/vim/autoload/mail/header/field.vim b/vim/autoload/mail/header/field.vim
index ab3d405a..e27d13c0 100644
--- a/vim/autoload/mail/header/field.vim
+++ b/vim/autoload/mail/header/field.vim
@@ -1,3 +1,5 @@
+" Add a field to a header, regardless of whether a field by the same name is
+" already present
function! mail#header#field#Add(header, name, body) abort
let new = {
\ 'name': a:name,
@@ -6,6 +8,9 @@ function! mail#header#field#Add(header, name, body) abort
call add(a:header['fields'], new)
endfunction
+" Set a field in a header, replacing the first one with the same name (if
+" any), and and removing any others
+"
function! mail#header#field#Set(header, name, body) abort
let fields = []
let new = {
@@ -28,6 +33,7 @@ function! mail#header#field#Set(header, name, body) abort
let a:header['fields'] = fields
endfunction
+" Remove a header field
function! mail#header#field#Clear(header, name) abort
let fields = []
for field in a:header['fields']