summaryrefslogtreecommitdiff
path: root/command.c
diff options
context:
space:
mode:
authorpommicket <pommicket@gmail.com>2023-03-23 15:40:43 -0400
committerpommicket <pommicket@gmail.com>2023-03-23 15:40:43 -0400
commit6643ff4c14cc27bf80189aadaf65c36ac2e7307f (patch)
tree4c2655192551a0298378024e24470e83776cddb5 /command.c
parentf47b513f8ac32d5eeebc1de187232c99751562a2 (diff)
increment-number and decrement-number
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);