Skip to content

Commit

Permalink
buffer help: switch keybind sets
Browse files Browse the repository at this point in the history
  • Loading branch information
TomasTomecek committed Jun 29, 2016
1 parent a16d843 commit 13627d1
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions sen/tui/views/help.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,19 +31,10 @@ def refresh(self):
SingleTextRow(self.buffer.description,
maps={"normal": "main_list_dg", "focus": MAIN_LIST_FOCUS}),
SingleTextRow(""),
SingleTextRow("Global Keybindings",
maps={"normal": "main_list_white", "focus": MAIN_LIST_FOCUS}),
SingleTextRow(""),
]

template.extend(assemble_rows(
[[SelectableText(key, maps=get_map("main_list_yellow")),
SelectableText(command, maps=get_map("main_list_lg"))]
for key, command in self.global_keybinds.items()],
ignore_columns=[1], dividechars=3))
if self.buffer.keybinds:
template += [
SingleTextRow(""),
SingleTextRow("Buffer-specific Keybindings",
maps={"normal": "main_list_white", "focus": MAIN_LIST_FOCUS}),
SingleTextRow(""),
Expand All @@ -54,6 +45,18 @@ def refresh(self):
for key, command in self.buffer.keybinds.items()],
ignore_columns=[1], dividechars=3))

template += [
SingleTextRow(""),
SingleTextRow("Global Keybindings",
maps={"normal": "main_list_white", "focus": MAIN_LIST_FOCUS}),
SingleTextRow("")
]
template.extend(assemble_rows(
[[SelectableText(key, maps=get_map("main_list_yellow")),
SelectableText(command, maps=get_map("main_list_lg"))]
for key, command in self.global_keybinds.items()],
ignore_columns=[1], dividechars=3))

self.set_body(template)
self.set_focus(0)

Expand Down

0 comments on commit 13627d1

Please sign in to comment.