Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions command.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ var CommandFuncs = map[parser.CommandType]CommandFunc{
token.PAGE_DOWN: ExecuteKey(input.PageDown),
token.SCROLL_UP: ExecuteScroll(-1),
token.SCROLL_DOWN: ExecuteScroll(1),
token.HOME: ExecuteKey(input.Home),
token.END: ExecuteKey(input.End),
token.HIDE: ExecuteHide,
token.REQUIRE: ExecuteRequire,
token.SHOW: ExecuteShow,
Expand Down Expand Up @@ -237,6 +239,10 @@ func ExecuteCtrl(c parser.Command, v *VHS) error {
inputKey = &input.ArrowUp
case "Down":
inputKey = &input.ArrowDown
case "Home":
inputKey = &input.Home
case "End":
inputKey = &input.End
default:
r := rune(key[0])
if k, ok := keymap[r]; ok {
Expand Down
2 changes: 1 addition & 1 deletion command_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ func TestCommand(t *testing.T) {
t.Errorf("Expected %d commands, got %d", numberOfCommands, len(parser.CommandTypes))
}

const numberOfCommandFuncs = 31
const numberOfCommandFuncs = 33
if len(CommandFuncs) != numberOfCommandFuncs {
t.Errorf("Expected %d commands, got %d", numberOfCommandFuncs, len(CommandFuncs))
}
Expand Down
2 changes: 2 additions & 0 deletions parser/parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,8 @@ func (p *Parser) parseCtrl() Command {
peek.Type == token.RIGHT,
peek.Type == token.UP,
peek.Type == token.DOWN,
peek.Type == token.HOME,
peek.Type == token.END,
peek.Type == token.STRING && len(peek.Literal) == 1:
args = append(args, peek.Literal)
default:
Expand Down