| 118 | }; |
| 119 | |
| 120 | static void list(color_ostream &out) { |
| 121 | DEBUG(log).print("listing active hotkeys\n"); |
| 122 | bool was_valid = valid; |
| 123 | if (!valid) |
| 124 | find_active_keybindings(out, Gui::getCurViewscreen(true), false); |
| 125 | |
| 126 | out.print("Valid keybindings for the current focus:\n {}\n", |
| 127 | join_strings("\n", Gui::getCurFocus(true))); |
| 128 | std::for_each(sorted_keys.begin(), sorted_keys.end(), [&](const string &sym) { |
| 129 | out.print("{}: {}\n", sym, current_bindings[sym]); |
| 130 | }); |
| 131 | |
| 132 | if (!was_valid) |
| 133 | cleanupHotkeys(NULL); |
| 134 | } |
| 135 | |
| 136 | static bool invoke_command(color_ostream &out, const size_t index) { |
| 137 | auto screen = Core::getTopViewscreen(); |
no test coverage detected