1
0
mirror of https://github.com/makew0rld/amfora.git synced 2024-06-19 19:25:24 +00:00

🐛 Allow open new tab while loading

This commit is contained in:
makeworld 2020-07-28 17:16:57 -04:00
parent 56a56896c9
commit 420b8a83a2
3 changed files with 16 additions and 14 deletions

View File

@ -23,6 +23,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Only one request is made for each URL - `v1.3.0` accidentally made two requests each time (#50)
- Using the `..` command doesn't keep the query string (#49)
- Any error that occurs when downloading a file will be displayed, and the partially downloaded file will be deleted
- Allow for opening a new tab while the current one is loading
## [1.3.0] - 2020-07-10

View File

@ -3,7 +3,8 @@
## Issues
- URL for each tab should not be stored as a string - in the current code there's lots of reparsing the URL
- Can't go back or do other things while page is loading - need a way to stop `handleURL`
- Allow for opening a new tab while the current one is loading
## Regressions
- Can't leave the help window
- Can't interact with page after clicking Cancel on bkmk (and other?) modal(s)

View File

@ -253,19 +253,6 @@ func Init() {
}
switch event.Key() {
case tcell.KeyCtrlT:
if tabs[curTab].page.Mode == structs.ModeLinkSelect {
next, err := resolveRelLink(tabs[curTab], tabs[curTab].page.Url, tabs[curTab].page.Selected)
if err != nil {
Error("URL Error", err.Error())
return nil
}
NewTab()
URL(next)
} else {
NewTab()
}
return nil
case tcell.KeyCtrlR:
Reload()
return nil
@ -341,6 +328,19 @@ func Init() {
// All the keys and operations that can work while a tab IS loading
switch event.Key() {
case tcell.KeyCtrlT:
if tabs[curTab].page.Mode == structs.ModeLinkSelect {
next, err := resolveRelLink(tabs[curTab], tabs[curTab].page.Url, tabs[curTab].page.Selected)
if err != nil {
Error("URL Error", err.Error())
return nil
}
NewTab()
URL(next)
} else {
NewTab()
}
return nil
case tcell.KeyCtrlW:
CloseTab()
return nil