From 5109024ac6023da89135c8cb60562ef3c1d409fa Mon Sep 17 00:00:00 2001 From: delthas Date: Wed, 14 Jul 2021 22:44:03 +0200 Subject: Make buffers indexed, and refer to indexes with /BUFFER Fixes: #29 --- commands.go | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'commands.go') 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) } -- cgit v1.2.3