diff options
Diffstat (limited to 'command.c')
-rw-r--r-- | command.c | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -203,14 +203,14 @@ void command_execute_ex(Ted *ted, Command c, const CommandArgument *full_argumen break; case CMD_UP: if (ted->selector_open) selector_up(ted, ted->selector_open, argument); - else if (ted->menu == MENU_SHELL && buffer == &ted->line_buffer) + else if (menu_is_open(ted, MENU_SHELL) && buffer == &ted->line_buffer) menu_shell_up(ted); else if (buffer) buffer_cursor_move_up(buffer, argument); autocomplete_close(ted); break; case CMD_DOWN: if (ted->selector_open) selector_down(ted, ted->selector_open, argument); - else if (ted->menu == MENU_SHELL && buffer == &ted->line_buffer) + else if (menu_is_open(ted, MENU_SHELL) && buffer == &ted->line_buffer) menu_shell_down(ted); else if (buffer) buffer_cursor_move_down(buffer, argument); autocomplete_close(ted); @@ -328,7 +328,7 @@ void command_execute_ex(Ted *ted, Command c, const CommandArgument *full_argumen if (ted->replace && buffer == &ted->find_buffer) { ted_switch_to_buffer(ted, &ted->replace_buffer); buffer_select_all(buffer); - } else if (ted->menu == MENU_COMMAND_SELECTOR && buffer == &ted->argument_buffer) { + } else if (menu_is_open(ted, MENU_COMMAND_SELECTOR) && buffer == &ted->argument_buffer) { buffer = &ted->line_buffer; ted_switch_to_buffer(ted, buffer); buffer_select_all(buffer); @@ -345,7 +345,7 @@ void command_execute_ex(Ted *ted, Command c, const CommandArgument *full_argumen if (ted->replace && buffer == &ted->replace_buffer) { ted_switch_to_buffer(ted, &ted->find_buffer); buffer_select_all(buffer); - } else if (ted->menu == MENU_COMMAND_SELECTOR && buffer == &ted->line_buffer) { + } else if (menu_is_open(ted, MENU_COMMAND_SELECTOR) && buffer == &ted->line_buffer) { buffer = &ted->argument_buffer; ted_switch_to_buffer(ted, buffer); buffer_select_all(buffer); @@ -563,7 +563,7 @@ void command_execute_ex(Ted *ted, Command c, const CommandArgument *full_argumen break; case CMD_TAB_CLOSE: { - if (ted->menu) { + if (menu_is_any_open(ted)) { menu_close(ted); } else if (ted->find) { find_close(ted); @@ -629,7 +629,7 @@ void command_execute_ex(Ted *ted, Command c, const CommandArgument *full_argumen *ted->message_shown = '\0'; } else if (autocomplete_is_open(ted)) { autocomplete_close(ted); - } else if (ted->menu) { + } else if (menu_is_any_open(ted)) { menu_escape(ted); } else { if (ted->find) { |