From d79458f464abccdb43e7d14753577698667ec81c Mon Sep 17 00:00:00 2001 From: Tim Culverhouse Date: Sun, 11 Dec 2022 15:11:25 -0600 Subject: 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 Tested-by: Bence Ferdinandy --- lib/msgstore.go | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lib') 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 { -- cgit