Open xunam opened 12 years ago
yes. this is line 165 in commands/search.py
i believe.
instead of get_total_messages we should use dbmanager.count_messages (http://alot.readthedocs.org/en/latest/api/database.html#alot.db.DBManager.count_messages) using something like
'id:%s' and (%s)' % (thread.get_id(), currentquerystring)
check out this patch, if its ok for you i'll push it to testing..
For the use case I was describing, it seems to work fine.
Pushing the experiment further, I still get inconsistent counts in the following scenario (which I admit is rather artificial...), assuming we are on the view for tag inbox:
:tag inbox
to tag the whole thread, the message count does not change (should be incremented by 2):untag inbox
to remove the thread from the view, the message count is decremented by 3you're right: i totally forgot about incrementing the result count.
this refresh
function we use as callback after flushing needs to update this as well.
this should do it..
Not quite. Here is an experiment:
tag:inbox AND NOT tag:killed
yields 42 messageskilled
and inbox
, B has tag inbox
onlyuntag killed
Looks like some -=
should be a +=
, and a display refresh is missing.
next try
i take this one is ok then? will push this to testing
pushed to master
I have a similar problem. One particular search doesn't show any messages (empty buffer), but the message count shows incorrectly 58 messages.
searching with notmuch for the same search terms shows 0 messages, but usign --exclude=false
shows 58 messages as well.
So it seems the message count wrongly include messages tagged with one of the exclude_tags
, while the search result doesn't (correctly).
this sounds like a bug. A quick inspection of the search buffer code suggests that excluded tags should also be excluded when counting results for the statusline.
Is there an example notmuch database you know of that I could use to reproduce issues and report bugs without the need of anonymising ? That would really help debugging this issue.
yes it would. We don't have this yet. But there is a test corpus in the notmuch test suite..
When opening a search buffer, the status bar indicates the number of messages matching the query and the buffer displays the summaries of threads containing such messages. When retagging messages, this message count is not updated consistently. The typical case is when removing the 'inbox' tag from a thread in the initial view: the message count is decremented by the total number of messages in the thread, not the number of messages that matched the query.