From 95f077c083648dedbe7523bfe85eb2f7e984ab20 Mon Sep 17 00:00:00 2001 From: makeworld Date: Sat, 19 Dec 2020 20:19:47 -0500 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20Ability=20to=20go=20back=20to=20new?= =?UTF-8?q?=20tab=20page?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 1 + display/display.go | 6 ++---- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 04dcf35..80a54b1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Time out when header takes too long - Preformatted text is now light yellow by default - Downloading a file no longer uses a second request +- You can go back to the new tab page in history (#96) ### Fixed - Single quotes are used in the default config for commands and paths so that Windows paths with backslashes will be parsed correctly diff --git a/display/display.go b/display/display.go index 2110745..e35d79f 100644 --- a/display/display.go +++ b/display/display.go @@ -439,10 +439,8 @@ func NewTab() { tabs = append(tabs, makeNewTab()) temp := newTabPage // Copy setPage(tabs[curTab], &temp) - - // Can't go backwards, but this isn't the first page either. - // The first page will be the next one the user goes to. - tabs[curTab].history.pos = -1 + tabs[curTab].addToHistory("about:newtab") + tabs[curTab].history.pos = 0 // Manually set as first page tabPages.AddAndSwitchToPage(strconv.Itoa(curTab), tabs[curTab].view, true) App.SetFocus(tabs[curTab].view)