aboutsummaryrefslogtreecommitdiffhomepage
path: root/vim
diff options
context:
space:
mode:
authorGravatar Jason Woofenden <jason@jasonwoof.com>2011-07-11 01:40:07 -0400
committerGravatar Felipe Contreras <felipe.contreras@gmail.com>2011-07-16 21:57:38 +0300
commitf5c20b8b08c35b5026538b14c45e115a991b3bdd (patch)
treeabe39632b4b86945ca8b8c395af47b906b367eb8 /vim
parent2b79776eedf5e59332921eb071b5412c12499cb6 (diff)
vim: fix from list reformatting in search view
This patch rewrites the reformatting of the from list so it shows full capitalized names when available (without truncating them as the old code did) and removes the pipe characters that appear between some names. The old code appears to assume from list (the list of senders in the thread) coming from notmuch would be e-mail addresses, but in this version it is mostly full names. Also in this version, the names are sometimes separated by pipe instead of comma. For consistency with old versions, names are still truncated at the first period. Perhaps they shouldn't be though. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Diffstat (limited to 'vim')
-rw-r--r--vim/plugin/notmuch.vim10
1 files changed, 5 insertions, 5 deletions
diff --git a/vim/plugin/notmuch.vim b/vim/plugin/notmuch.vim
index 49a52eb4..255df071 100644
--- a/vim/plugin/notmuch.vim
+++ b/vim/plugin/notmuch.vim
@@ -262,12 +262,12 @@ function! s:NM_cmd_search_fmtline(line)
return 'ERROR PARSING: ' . a:line
endif
let max = g:notmuch_search_from_column_width
- let flist = []
- for at in split(m[4], ", ")
- let p = min([stridx(at, "."), stridx(at, "@")])
- call insert(flist, tolower(at[0:p - 1]))
+ let flist = {}
+ for at in split(m[4], '[|,] ')
+ let p = split(at, '[@.]')
+ let flist[p[0]] = 1
endfor
- let from = join(flist, ", ")
+ let from = join(keys(flist), ", ")
return printf("%-12s %3s %-20.20s | %s (%s)", m[2], m[3], from, m[5], m[6])
endfunction