🐛 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
1 changed files with 9 additions and 1 deletions

View File

@ -231,7 +231,9 @@ func Init() {
switch event.Key() {
case tcell.KeyCtrlT:
if selectedLink != "" {
if selectedLink == "" {
NewTab()
} else {
next, err := resolveRelLink(tabMap[curTab].Url, selectedLink)
if err != nil {
Error("URL Error", err.Error())
@ -348,6 +350,12 @@ func NewTab() {
// SetDoneFunc to do link highlighting
// 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()
tabMap[curTab] = &newTabPage
setLeftMargin(tabMap[curTab])