1
0
mirror of https://github.com/makew0rld/amfora.git synced 2024-12-04 14:46:29 -05:00

🐛 Allow opening regular new tabs

This is a regression due to previous commits, and it worked fine in v1.1.0
This commit is contained in:
makeworld 2020-07-01 20:44:16 -04:00
parent 8ce0c1ecac
commit a480c0eed8

View File

@ -231,7 +231,9 @@ func Init() {
switch event.Key() { switch event.Key() {
case tcell.KeyCtrlT: case tcell.KeyCtrlT:
if selectedLink != "" { if selectedLink == "" {
NewTab()
} else {
next, err := resolveRelLink(tabMap[curTab].Url, selectedLink) next, err := resolveRelLink(tabMap[curTab].Url, selectedLink)
if err != nil { if err != nil {
Error("URL Error", err.Error()) Error("URL Error", err.Error())
@ -348,6 +350,12 @@ func NewTab() {
// SetDoneFunc to do link highlighting // SetDoneFunc to do link highlighting
// Add view to pages and switch to it // Add view to pages and switch to it
// But first, turn off link selecting mode in the current tab
if curTab > -1 {
tabViews[curTab].Highlight("")
}
selectedLink = ""
curTab = NumTabs() curTab = NumTabs()
tabMap[curTab] = &newTabPage tabMap[curTab] = &newTabPage
setLeftMargin(tabMap[curTab]) setLeftMargin(tabMap[curTab])