Ability to go back to new tab page

This commit is contained in:
makeworld 2020-12-19 20:19:47 -05:00
parent ae9bfa5e2b
commit 95f077c083
2 changed files with 3 additions and 4 deletions

View File

@ -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

View File

@ -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)