aerc/worker/notmuch/eventhandlers.go
Koni Marti 318f7d252c notmuch: fix cursor movement in threaded view
Set the SkipSort flag when sending directory infos for counting
purposes. Without this, the directory infos would trigger a directory
fetch which could bring the notmuch threads out of sync with the message
list. The notmuch backend sends these directory infos automatically
every minute.

To reproduce the weird cursor movement in notmuch's threaded view:
1. enter threaded view in notmuch
2. wait 1 min (until the auto directory infos are sent out)
3. move cursor around and notice how it jumps over threads

Signed-off-by: Koni Marti <koni.marti@gmail.com>
Tested-by: Tim Culverhouse <tim@timculverhouse.com>
2022-07-31 20:02:46 +02:00

27 lines
575 B
Go

//go:build notmuch
// +build notmuch
package notmuch
import "git.sr.ht/~rjarry/aerc/logging"
func (w *worker) handleNotmuchEvent(et eventType) error {
switch ev := et.(type) {
case *updateDirCounts:
return w.handleUpdateDirCounts(ev)
default:
return errUnsupported
}
}
func (w *worker) handleUpdateDirCounts(ev eventType) error {
for name, query := range w.nameQueryMap {
info, err := w.buildDirInfo(name, query, true)
if err != nil {
logging.Errorf("could not gather DirectoryInfo: %v", err)
continue
}
w.w.PostMessage(info, nil)
}
return nil
}