summaryrefslogtreecommitdiff
path: root/commands.go
diff options
context:
space:
mode:
authordelthas <delthas@dille.cc>2021-07-14 22:44:03 +0200
committerHubert Hirtz <hubert@hirtz.pm>2021-07-15 09:18:01 +0200
commit5109024ac6023da89135c8cb60562ef3c1d409fa (patch)
tree43992421d65cbf04d1c253d6caea4789734c6a56 /commands.go
parentui: Introduce a vertical member list on channels (diff)
Make buffers indexed, and refer to indexes with /BUFFER
Fixes: #29
Diffstat (limited to 'commands.go')
-rw-r--r--commands.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/commands.go b/commands.go
index 447340d..626ba00 100644
--- a/commands.go
+++ b/commands.go
@@ -2,6 +2,7 @@ package senpai
import (
"fmt"
+ "strconv"
"strings"
"time"
@@ -478,6 +479,12 @@ func (app *App) handleInput(buffer, content string) error {
func commandDoBuffer(app *App, buffer string, args []string) error {
name := args[0]
+ i, err := strconv.Atoi(name)
+ if err == nil {
+ if app.win.JumpBufferIndex(i) {
+ return nil
+ }
+ }
if !app.win.JumpBuffer(args[0]) {
return fmt.Errorf("none of the buffers match %q", name)
}