From 293a1a1db03a26d261b8c7bce2a9c7c64fbc8f7b Mon Sep 17 00:00:00 2001 From: makeworld Date: Sun, 28 Jun 2020 21:06:58 -0400 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20Add=20alt-arrows=20for=20history=20?= =?UTF-8?q?nav=20-=20fixes=20#23?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 3 +++ display/display.go | 12 ++++++++++++ display/help.go | 4 ++-- 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 03724fd..99284c7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] +### Added +- Alt-Left and Alt-Right for history navigation (#23) + ### Fixed - Actual unicode bullet symbol is used for lists: U+2022 - Performance when loading very long cached pages improved (#26) diff --git a/display/display.go b/display/display.go index b8b5a13..0b2eaca 100644 --- a/display/display.go +++ b/display/display.go @@ -190,6 +190,18 @@ func Init() { return event } + // History arrow keys + if event.Modifiers() == tcell.ModAlt { + if event.Key() == tcell.KeyLeft { + histBack() + return nil + } + if event.Key() == tcell.KeyRight { + histForward() + return nil + } + } + switch event.Key() { case tcell.KeyCtrlT: NewTab() diff --git a/display/help.go b/display/help.go index fe17fce..9a69ee8 100644 --- a/display/help.go +++ b/display/help.go @@ -13,8 +13,8 @@ Esc|Leave the help Arrow keys, h/j/k/l|Scroll and move a page. Tab|Navigate to the next item in a popup. Shift-Tab|Navigate to the previous item in a popup. -b|Go back a page -f|Go forward a page +b, Alt-Left|Go back a page +f, Alt-Right|Go forward a page g|Go to top of document G|Go to bottom of document spacebar|Open bar at the bottom - type a URL or link number