]> git.cworth.org Git - notmuch/commitdiff
Vim: Ensure that every queries respect excluded tags
authorJules Aguillon <juloo.dsi@gmail.com>
Tue, 16 Feb 2021 23:43:16 +0000 (00:43 +0100)
committerDavid Bremner <david@tethera.net>
Mon, 26 Apr 2021 23:20:57 +0000 (20:20 -0300)
This makes sure that the bug solved by the previous commit won't happen again
and remove some dupplication.
This shouldn't have any side effect.

vim/notmuch.vim

index c1c2f63d20178dab69f92c9ff9aab4631dda6ee5..8e547d4e50a16202c1a2a8c99d414e6a7f898f08 100644 (file)
@@ -317,9 +317,6 @@ ruby << EOF
        $curbuf.render do |b|
                q = $curbuf.query(get_cur_view)
                q.sort = Notmuch::SORT_OLDEST_FIRST
-               $exclude_tags.each { |t|
-                       q.add_tag_exclude(t)
-               }
                msgs = q.search_messages
                msgs.each do |msg|
                        m = Mail.read(msg.filename)
@@ -643,9 +640,6 @@ 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.count_threads : q.count_messages
                                b << "%9d %-20s (%s)" % [count, name, search]
@@ -657,9 +651,6 @@ 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
 
@@ -711,6 +702,9 @@ ruby << EOF
                def query(*args)
                        q = @db.query(*args)
                        @queries << q
+                       $exclude_tags.each { |t|
+                           q.add_tag_exclude(t)
+                       }
                        q
                end