summaryrefslogtreecommitdiff
path: root/command.c
diff options
context:
space:
mode:
authorpommicket <pommicket@gmail.com>2023-09-08 22:59:47 -0400
committerpommicket <pommicket@gmail.com>2023-09-08 22:59:47 -0400
commit0dcfd5a4f1fd865c24c01b17b214e1f72e4c06fe (patch)
treed693d70a57713cf4dbe48d30159100bab279c77d /command.c
parentf86b0aa1e843646056c08a91fcc759aa0d8a57ba (diff)
LSP code formatting (not entirely working yet)
Diffstat (limited to 'command.c')
-rw-r--r--command.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/command.c b/command.c
index 07d3856..2407551 100644
--- a/command.c
+++ b/command.c
@@ -105,6 +105,8 @@ static CommandName command_names[] = {
{"increment-number", CMD_INCREMENT_NUMBER},
{"decrement-number", CMD_DECREMENT_NUMBER},
{"rename-symbol", CMD_RENAME_SYMBOL},
+ {"format-file", CMD_FORMAT_FILE},
+ {"format-selection", CMD_FORMAT_SELECTION},
};
static_assert_if_possible(arr_count(command_names) == CMD_COUNT)
@@ -703,5 +705,11 @@ void command_execute_ex(Ted *ted, Command c, const CommandArgument *full_argumen
if (buffer && buffer_lsp(buffer))
menu_open(ted, MENU_RENAME_SYMBOL);
break;
+ case CMD_FORMAT_FILE:
+ format_file(ted);
+ break;
+ case CMD_FORMAT_SELECTION:
+ format_selection(ted);
+ break;
}
}