diff options
author | pommicket <pommicket@gmail.com> | 2022-12-31 23:28:03 -0500 |
---|---|---|
committer | pommicket <pommicket@gmail.com> | 2022-12-31 23:28:03 -0500 |
commit | 57834dc0b116a62b806781ddec101bca4cda3abb (patch) | |
tree | e93e85b8cd2de7198cabe11abe1a779dbdf7b7cb /menu.c | |
parent | 993d4f50d13c3a703d634d989af7dd8b96ae8c3d (diff) |
start moving things around
Diffstat (limited to 'menu.c')
-rw-r--r-- | menu.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -265,13 +265,13 @@ static void menu_update(Ted *ted) { } break; case MENU_COMMAND_SELECTOR: { Selector *selector = &ted->command_selector; - SelectorEntry *entries = selector->entries = calloc(arr_count(command_names), sizeof *selector->entries); + SelectorEntry *entries = selector->entries = calloc(CMD_COUNT, sizeof *selector->entries); char *search_term = str32_to_utf8_cstr(buffer_get_line(line_buffer, 0)); if (entries) { SelectorEntry *entry = entries; - for (size_t i = 0; i < arr_count(command_names); ++i) { - char const *name = command_names[i].name; - if (command_names[i].cmd != CMD_UNKNOWN && stristr(name, search_term)) { + for (Command c = 0; c < CMD_COUNT; ++c) { + char const *name = command_to_str(c); + if (c != CMD_UNKNOWN && *name && stristr(name, search_term)) { entry->name = name; entry->color = colors[COLOR_TEXT]; ++entry; |