diff options
Diffstat (limited to 'commands.go')
-rw-r--r-- | commands.go | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/commands.go b/commands.go index b3c2d14..6be50ed 100644 --- a/commands.go +++ b/commands.go @@ -100,6 +100,14 @@ func init() { Desc: "show or set the topic of the current channel", Handle: commandDoTopic, }, + "BUFFER": { + AllowHome: true, + MinArgs: 1, + MaxArgs: 1, + Usage: "<name>", + Desc: "switch to the buffer containing a substring", + Handle: commandDoBuffer, + }, } } @@ -375,3 +383,12 @@ func (app *App) handleInput(buffer, content string) error { return cmd.Handle(app, buffer, args) } + +func commandDoBuffer(app *App, buffer string, args []string) error { + name := args[0] + if !app.win.JumpBuffer(args[0]) { + return fmt.Errorf("none of the buffers match %q", name) + } + + return nil +} |