simplify how the context system works

This commit is contained in:
Jesse Duffield 2019-11-10 16:33:31 +11:00
parent e85310c0a9
commit 131113b065
11 changed files with 362 additions and 374 deletions

View file

@ -83,15 +83,13 @@ func getBindingSections(mApp *app.App) []*bindingSection {
bindingSections = addBinding(title, bindingSections, binding)
}
for view, contexts := range mApp.Gui.GetContextMap() {
for contextName, contextBindings := range contexts {
translatedView := localisedTitle(mApp, view)
translatedContextName := localisedTitle(mApp, contextName)
title := fmt.Sprintf("%s (%s)", translatedView, translatedContextName)
for contextName, contextBindings := range mApp.Gui.GetContextMap() {
translatedView := localisedTitle(mApp, contextBindings[0].ViewName)
translatedContextName := localisedTitle(mApp, contextName)
title := fmt.Sprintf("%s (%s)", translatedView, translatedContextName)
for _, binding := range contextBindings {
bindingSections = addBinding(title, bindingSections, binding)
}
for _, binding := range contextBindings {
bindingSections = addBinding(title, bindingSections, binding)
}
}