summaryrefslogtreecommitdiff
path: root/command.c
diff options
context:
space:
mode:
authorpommicket <pommicket@gmail.com>2023-08-05 22:58:57 -0400
committerpommicket <pommicket@gmail.com>2023-08-05 22:58:57 -0400
commit518851c0cde788a807e640377a7093ab4e8c5b5f (patch)
treee18c5296d7b5b5450689402f65be1bd91d89845d /command.c
parent913a5a5dfbcf6789a1ac6b8c32fb23cdcdde995b (diff)
more dynamic menus (menus are currently broken)
Diffstat (limited to 'command.c')
-rw-r--r--command.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/command.c b/command.c
index 65ca61f..084981a 100644
--- a/command.c
+++ b/command.c
@@ -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) {