X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=vim%2Fnotmuch.vim;h=ad8b7c800cd5cca1b9b4c23fe226d57c4e414191;hp=cad95178e29d18c4b142b5bc5948c6253f3a4b8a;hb=410b96080ceec15ced70e684115f604380c5b4f6;hpb=ce44657c9e4919b1e4bbbbbe37dbd72257d40736 diff --git a/vim/notmuch.vim b/vim/notmuch.vim index cad95178..ad8b7c80 100644 --- a/vim/notmuch.vim +++ b/vim/notmuch.vim @@ -477,6 +477,7 @@ ruby << EOF $db_name = nil $email = $email_name = $email_address = nil + $exclude_tags = [] $searches = [] $threads = [] $messages = [] @@ -496,6 +497,8 @@ ruby << EOF $email_address = get_config_item('user.primary_email') $email_name = get_config_item('user.name') $email = "%s <%s>" % [$email_name, $email_address] + ignore_tags = get_config_item('search.exclude_tags') + $exclude_tags = ignore_tags.split("\n") end def vim_puts(s) @@ -637,8 +640,11 @@ ruby << EOF $searches.clear folders.each do |name, search| q = $curbuf.query(search) + $exclude_tags.each { |t| + q.add_tag_exclude(t) + } $searches << search - count = count_threads ? q.search_threads.count : q.search_messages.count + count = count_threads ? q.count_threads : q.count_messages b << "%9d %-20s (%s)" % [count, name, search] end end @@ -648,6 +654,9 @@ ruby << EOF date_fmt = VIM::evaluate('g:notmuch_date_format') q = $curbuf.query(search) q.sort = Notmuch::SORT_NEWEST_FIRST + $exclude_tags.each { |t| + q.add_tag_exclude(t) + } $threads.clear t = q.search_threads