| 134 | } |
| 135 | |
| 136 | static bool invoke_command(color_ostream &out, const size_t index) { |
| 137 | auto screen = Core::getTopViewscreen(); |
| 138 | if (sorted_keys.size() <= index || |
| 139 | !Gui::matchFocusString(MENU_SCREEN_FOCUS_STRING)) |
| 140 | return false; |
| 141 | |
| 142 | auto cmd = current_bindings[sorted_keys[index]]; |
| 143 | DEBUG(log).print("invoking command: '{}'\n", cmd); |
| 144 | |
| 145 | { |
| 146 | Screen::Hide hideGuard(screen, Screen::Hide::RESTORE_AT_TOP); |
| 147 | Core::getInstance().runCommand(out, cmd); |
| 148 | } |
| 149 | |
| 150 | Screen::dismiss(screen); |
| 151 | return true; |
| 152 | } |
| 153 | |
| 154 | static command_result hotkeys_cmd(color_ostream &out, vector <string> & parameters) { |
| 155 | if (!parameters.size()) { |
no test coverage detected