Authentication-Results: mail-b.sr.ht; dkim=none Received: from tmailer.gwdg.de (tmailer.gwdg.de [134.76.10.23]) by mail-b.sr.ht (Postfix) with ESMTPS id 314A111EF12 for <~taiite/public-inbox@lists.sr.ht>; Mon, 6 Dec 2021 11:50:08 +0000 (UTC) Received: from excmbx-13.um.gwdg.de ([134.76.9.222] helo=email.gwdg.de) by mailer.gwdg.de with esmtp (GWDG Mailer) (envelope-from ) id 1muCVQ-000Fv9-Sj for ~taiite/public-inbox@lists.sr.ht; Mon, 06 Dec 2021 12:50:04 +0100 Received: from m5.localdomain (10.250.9.199) by EXCMBX-13.um.gwdg.de (134.76.9.222) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P521) id 15.1.2375.17; Mon, 6 Dec 2021 12:50:04 +0100 From: Leon Henrik Plickat To: <~taiite/public-inbox@lists.sr.ht> CC: Leon Henrik Plickat Subject: [PATCH v2] Allow selecting buffers with Alt+{1..9} Date: Mon, 6 Dec 2021 12:49:52 +0100 Message-ID: <20211206114952.1614-1-leonhenrik.plickat@stud.uni-goettingen.de> X-Mailer: git-send-email 2.34.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.250.9.199] X-ClientProxiedBy: excmbx-11.um.gwdg.de (134.76.9.220) To EXCMBX-13.um.gwdg.de (134.76.9.222) X-Virus-Scanned: (clean) by clamav --- v1 -> v2: document keybinds in man page app.go | 3 +++ doc/senpai.1.scd | 3 +++ 2 files changed, 6 insertions(+) diff --git a/app.go b/app.go index 2b0ba82..956c89e 100644 --- a/app.go +++ b/app.go @@ -513,6 +513,7 @@ func (app *App) handleKeyEvent(ev *tcell.EventKey) { } case tcell.KeyBacktab: ok := app.win.InputAutoComplete(-1) + if ok { app.typing() } @@ -535,6 +536,8 @@ func (app *App) handleKeyEvent(ev *tcell.EventKey) { app.win.ScrollDownHighlight() case 'p': app.win.ScrollUpHighlight() + case '1', '2', '3', '4', '5', '6', '7', '8', '9': + app.win.GoToBufferNo(int(ev.Rune()-'0') - 1) } } else { app.win.InputRune(ev.Rune()) diff --git a/doc/senpai.1.scd b/doc/senpai.1.scd index 7517d14..c64a82c 100644 --- a/doc/senpai.1.scd +++ b/doc/senpai.1.scd @@ -93,6 +93,9 @@ of messages are in the timeline: Go to the next highlight, or to the (most recent) end of the timeline if there is none. +*ALT-{1..9}* + Go to buffer by index. + *UP*, *DOWN*, *LEFT*, *RIGHT*, *HOME*, *END*, *BACKSPACE*, *DELETE* Edit the text in the input field. -- 2.34.0