summaryrefslogtreecommitdiff
path: root/command.c
diff options
context:
space:
mode:
Diffstat (limited to 'command.c')
-rw-r--r--command.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/command.c b/command.c
index 168597a..ed42e87 100644
--- a/command.c
+++ b/command.c
@@ -100,6 +100,8 @@ static CommandName command_names[] = {
{"macro-record", CMD_MACRO_RECORD},
{"macro-stop", CMD_MACRO_STOP},
{"macro-execute", CMD_MACRO_EXECUTE},
+ {"increment-number", CMD_INCREMENT_NUMBER},
+ {"decrement-number", CMD_DECREMENT_NUMBER},
};
static_assert_if_possible(arr_count(command_names) == CMD_COUNT)
@@ -177,6 +179,13 @@ void command_execute_ex(Ted *ted, Command c, CommandArgument full_argument, Comm
case CMD_NOOP:
break;
+ case CMD_INCREMENT_NUMBER:
+ buffer_change_number_at_cursor(buffer, argument);
+ break;
+ case CMD_DECREMENT_NUMBER:
+ buffer_change_number_at_cursor(buffer, -argument);
+ break;
+
case CMD_LEFT:
if (buffer) buffer_cursor_move_left(buffer, argument);
autocomplete_close(ted);