Created
March 4, 2018 00:51
-
-
Save vifon/511df1a75396b76c7a5e80f3c4b16fc9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Index: b/ranger/gui/widgets/view_base.py | |
=================================================================== | |
--- a/ranger/gui/widgets/view_base.py | |
+++ b/ranger/gui/widgets/view_base.py | |
@@ -112,15 +112,17 @@ class ViewBase(Widget, DisplayableContai | |
self.color_reset() | |
self.need_clear = True | |
hints = [] | |
- for key, value in self.fm.ui.keybuffer.pointer.items(): | |
- key = key_to_string(key) | |
- if isinstance(value, dict): | |
- text = '...' | |
- else: | |
- text = value | |
- if text.startswith('hint') or text.startswith('chain hint'): | |
- continue | |
- hints.append((key, text)) | |
+ def populate(keymap, prefix=""): | |
+ for key, value in keymap.items(): | |
+ key = prefix + key_to_string(key) | |
+ if isinstance(value, dict): | |
+ populate(value, key) | |
+ else: | |
+ text = value | |
+ if text.startswith('hint') or text.startswith('chain hint'): | |
+ continue | |
+ hints.append((key, text)) | |
+ populate(self.fm.ui.keybuffer.pointer) | |
hints.sort(key=lambda t: t[1]) | |
hei = min(self.hei - 1, len(hints)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment