aboutsummaryrefslogtreecommitdiffhomepage
path: root/vim
diff options
context:
space:
mode:
authorGravatar Felipe Contreras <felipe.contreras@gmail.com>2013-10-12 04:33:06 -0500
committerGravatar Felipe Contreras <felipe.contreras@gmail.com>2013-11-20 07:23:29 -0600
commit01859bd7ce98cd1a2938a628e1a21714016e0421 (patch)
tree40d59ec084668bb13cd95d73493d845bfb8da56d /vim
parent85b3dc9f0f33f7af1acb111738d3a1b37befcc01 (diff)
vim: show first message of the thread
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Diffstat (limited to 'vim')
-rw-r--r--vim/notmuch.vim6
1 files changed, 4 insertions, 2 deletions
diff --git a/vim/notmuch.vim b/vim/notmuch.vim
index 72bf73b3..11ea4fd3 100644
--- a/vim/notmuch.vim
+++ b/vim/notmuch.vim
@@ -557,6 +557,7 @@ ruby << EOF
def search_render(search)
date_fmt = VIM::evaluate('g:notmuch_rb_date_format')
q = $curbuf.query(search)
+ q.sort = Notmuch::SORT_NEWEST_FIRST
$threads.clear
t = q.search_threads
@@ -564,10 +565,11 @@ ruby << EOF
items.each do |e|
authors = e.authors.to_utf8.split(/[,|]/).map { |a| author_filter(a) }.join(",")
date = Time.at(e.newest_date).strftime(date_fmt)
+ subject = e.messages.first['subject']
if $mail_installed
- subject = Mail::Field.new("Subject: " + e.subject).to_s
+ subject = Mail::Field.new("Subject: " + subject).to_s
else
- subject = e.subject.force_encoding('utf-8')
+ subject = subject.force_encoding('utf-8')
end
b << "%-12s %3s %-20.20s | %s (%s)" % [date, e.matched_messages, authors, subject, e.tags]
$threads << e.thread_id