From a480c0eed8c623ac8a7f6092b8798d5fd75ae2c1 Mon Sep 17 00:00:00 2001 From: makeworld Date: Wed, 1 Jul 2020 20:44:16 -0400 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Allow=20opening=20regular=20new?= =?UTF-8?q?=20tabs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is a regression due to previous commits, and it worked fine in v1.1.0 --- display/display.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/display/display.go b/display/display.go index 8ac2812..cb4b118 100644 --- a/display/display.go +++ b/display/display.go @@ -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])