diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2019-11-10 16:33:31 +1100 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2019-11-10 22:32:13 +1100 |
commit | 131113b0657eea84f842e2c1e24d0ab1150505e5 (patch) | |
tree | f22c3e0db6ff43655a87bd30aac6f5406ecfab78 /scripts | |
parent | e85310c0a92a89167530241bdc3fc5f66a48706d (diff) |
simplify how the context system works
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/generate_cheatsheet.go | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/scripts/generate_cheatsheet.go b/scripts/generate_cheatsheet.go index f3d5e84db..56059d3bc 100644 --- a/scripts/generate_cheatsheet.go +++ b/scripts/generate_cheatsheet.go @@ -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 _, binding := range contextBindings { - bindingSections = addBinding(title, bindingSections, binding) - } + 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) } } |