From e78b7b85e4792f413175e13ef2fe437839b017a2 Mon Sep 17 00:00:00 2001 From: Reto Brunner Date: Fri, 24 Jan 2020 18:18:49 +0100 Subject: config: Strongly type context type The go compiler can't help much with untyped int constants. Even though the only valid constants are 0-3 it will happily accept 4 as input. Let's let the go compiler worry about correctness here. This also allows people not very familiar with the code to use it properly via auto completion. --- widgets/msglist.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'widgets/msglist.go') diff --git a/widgets/msglist.go b/widgets/msglist.go index 24a9940..9aff0d4 100644 --- a/widgets/msglist.go +++ b/widgets/msglist.go @@ -106,7 +106,7 @@ func (ml *MessageList) Draw(ctx *ui.Context) { } ctx.Fill(0, row, ctx.Width(), 1, ' ', style) - uiConfig := ml.conf.GetUiConfig(map[int]string{ + uiConfig := ml.conf.GetUiConfig(map[config.ContextType]string{ config.UI_CONTEXT_ACCOUNT: ml.aerc.SelectedAccount().AccountConfig().Name, config.UI_CONTEXT_FOLDER: ml.aerc.SelectedAccount().Directories().Selected(), config.UI_CONTEXT_SUBJECT: msg.Envelope.Subject, -- cgit v1.2.3