aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorTim Culverhouse <tim@timculverhouse.com>2022-12-11 15:11:25 -0600
committerRobin Jarry <robin@jarry.cc>2022-12-14 11:24:49 +0100
commitd79458f464abccdb43e7d14753577698667ec81c (patch)
treed3dd2ba22c4c441135db86e1ef465c04bca8d323 /lib
parent683df439f8df5f53ee00e96eb6b9d525b1c41ea9 (diff)
downloadaerc-d79458f464abccdb43e7d14753577698667ec81c.tar.gz
split: refactor split update logic
Refactor split update logic to more simply update the split. Through the evolution of the split logic, additional variables were stored within the account which allows for cleaner updating of the split. Compare selected UID instead of pointer to message when deciding not to update split. Allow splits to be created and closed when no message is selected. The split will be filled with a ui.Fill (blank). The user will only see a border at the split location when no message is selected. Rename clearSplit to closeSplit, as it is only used in the case when the user doesn't want a split anymore. Ensure that the selected UID is reset to the magic UID when there are no messages left in the message store. Signed-off-by: Tim Culverhouse <tim@timculverhouse.com> Tested-by: Bence Ferdinandy <bence@ferdinandy.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/msgstore.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/msgstore.go b/lib/msgstore.go
index 45513145..6710fa56 100644
--- a/lib/msgstore.go
+++ b/lib/msgstore.go
@@ -315,6 +315,9 @@ func (store *MessageStore) Update(msg types.WorkerMessage) {
}
}
store.uids = uids
+ if len(uids) == 0 {
+ store.Select(MagicUid)
+ }
var newResults []uint32
for _, res := range store.results {