summaryrefslogtreecommitdiff
path: root/command.c
diff options
context:
space:
mode:
Diffstat (limited to 'command.c')
-rw-r--r--command.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/command.c b/command.c
index 3b647f4..703f4bd 100644
--- a/command.c
+++ b/command.c
@@ -111,6 +111,8 @@ static CommandName command_names[] = {
{"indent-with-tabs", CMD_INDENT_WITH_TABS},
{"set-tab-width", CMD_SET_TAB_WIDTH},
{"debug-print-undo-history", CMD_DEBUG_PRINT_UNDO_HISTORY},
+ {"code-action", CMD_CODE_ACTION},
+ {"code-action-prev", CMD_CODE_ACTION_PREV},
};
static_assert_if_possible(arr_count(command_names) == CMD_COUNT)
@@ -344,6 +346,8 @@ void command_execute_ex(Ted *ted, Command c, const CommandArgument *full_argumen
buffer_select_all(buffer);
} else if (autocomplete_is_open(ted) || autocomplete_has_phantom(ted)) {
autocomplete_select_completion(ted);
+ } else if (code_action_is_open(ted)) {
+ code_action_select(ted);
} else if (buffer) {
if (buffer_has_selection(buffer))
buffer_indent_selection(buffer);
@@ -377,6 +381,8 @@ void command_execute_ex(Ted *ted, Command c, const CommandArgument *full_argumen
} else if (buffer) {
buffer_newline(buffer);
}
+ } else if (code_action_is_open(ted)) {
+ code_action_select(ted);
} else if (buffer) {
buffer_newline(buffer);
}
@@ -640,6 +646,8 @@ 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 (code_action_is_open(ted)) {
+ code_action_close(ted);
} else if (menu_is_any_open(ted)) {
menu_escape(ted);
} else {
@@ -740,5 +748,14 @@ void command_execute_ex(Ted *ted, Command c, const CommandArgument *full_argumen
case CMD_DEBUG_PRINT_UNDO_HISTORY:
buffer_print_undo_history(buffer);
break;
+ case CMD_CODE_ACTION:
+ if (code_action_is_open(ted))
+ code_action_next(ted);
+ else
+ code_action_open(ted);
+ break;
+ case CMD_CODE_ACTION_PREV:
+ code_action_prev(ted);
+ break;
}
}