diff --git a/command.go b/command.go index 2d6aa88ef..a1f0958c6 100644 --- a/command.go +++ b/command.go @@ -21,6 +21,8 @@ type CommandType TokenType // CommandTypes is a list of the available commands that can be executed. var CommandTypes = []CommandType{ //nolint: deadcode BACKSPACE, + DELETE, + INSERT, CTRL, ALT, DOWN, @@ -63,6 +65,8 @@ type CommandFunc func(c Command, v *VHS) // CommandFuncs maps command types to their executable functions. var CommandFuncs = map[CommandType]CommandFunc{ BACKSPACE: ExecuteKey(input.Backspace), + DELETE: ExecuteKey(input.Delete), + INSERT: ExecuteKey(input.Insert), DOWN: ExecuteKey(input.ArrowDown), ENTER: ExecuteKey(input.Enter), LEFT: ExecuteKey(input.ArrowLeft), diff --git a/command_test.go b/command_test.go index 80915ad9d..e7cbbbd39 100644 --- a/command_test.go +++ b/command_test.go @@ -6,12 +6,12 @@ import ( ) func TestCommand(t *testing.T) { - const numberOfCommands = 25 + const numberOfCommands = 27 if len(CommandTypes) != numberOfCommands { t.Errorf("Expected %d commands, got %d", numberOfCommands, len(CommandTypes)) } - const numberOfCommandFuncs = 25 + const numberOfCommandFuncs = 27 if len(CommandFuncs) != numberOfCommandFuncs { t.Errorf("Expected %d commands, got %d", numberOfCommandFuncs, len(CommandFuncs)) } diff --git a/examples/demo.tape b/examples/demo.tape index 711f4d1b2..405a00bbd 100644 --- a/examples/demo.tape +++ b/examples/demo.tape @@ -37,6 +37,8 @@ # Keys: # Escape[@