aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBence Ferdinandy <bence@ferdinandy.com>2022-12-12 09:25:02 +0100
committerRobin Jarry <robin@jarry.cc>2022-12-14 11:24:49 +0100
commitd48522266319828f55baab6de39222de17157d6b (patch)
tree3f39a5fed09ec954ed27c2e063276c68a9a9c635
parent9c56417892736af67d5c67d34b6d59458e27fe27 (diff)
downloadaerc-d48522266319828f55baab6de39222de17157d6b.tar.gz
style: make marked more important than search
Currently it's not possible to define combinations of marked and searched. Since searched messages are just a convenience, while marked message can be operated upon, make sure that when a message is both marked and a search result the marked styleset is applied. Signed-off-by: Bence Ferdinandy <bence@ferdinandy.com> Acked-by: Moritz Poldrack <moritz@poldrack.dev>
-rw-r--r--widgets/msglist.go9
1 files changed, 4 insertions, 5 deletions
diff --git a/widgets/msglist.go b/widgets/msglist.go
index fc5b46b5..e3f3f14e 100644
--- a/widgets/msglist.go
+++ b/widgets/msglist.go
@@ -232,17 +232,16 @@ func (ml *MessageList) drawRow(textWidth int, ctx *ui.Context, uid uint32, row i
if _, ok := store.Deleted[msg.Uid]; ok {
msg_styles = append(msg_styles, config.STYLE_MSGLIST_DELETED)
}
+ // search result
+ if store.IsResult(msg.Uid) {
+ msg_styles = append(msg_styles, config.STYLE_MSGLIST_RESULT)
+ }
// marked message
if store.Marker().IsMarked(msg.Uid) {
msg_styles = append(msg_styles, config.STYLE_MSGLIST_MARKED)
}
- // search result
- if store.IsResult(msg.Uid) {
- msg_styles = append(msg_styles, config.STYLE_MSGLIST_RESULT)
- }
-
var style tcell.Style
// current row
if msg.Uid == ml.store.SelectedUid() {