From 602acff42f3d10601de1ca8d02a36f32ba7ea3a4 Mon Sep 17 00:00:00 2001 From: Dmytro Maluka Date: Sun, 16 Jun 2024 13:53:09 +0200 Subject: [PATCH] Fix non-working mouse click on top-left and top-right cells Scroll the tab bar only if there actually is the tab bar, otherwise propagate the mouse click event to the bufpane. --- internal/action/tab.go | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/internal/action/tab.go b/internal/action/tab.go index 2a1f5a62..9c6bd01e 100644 --- a/internal/action/tab.go +++ b/internal/action/tab.go @@ -107,14 +107,15 @@ func (t *TabList) HandleEvent(event tcell.Event) { mx, my := e.Position() switch e.Buttons() { case tcell.Button1: - if my == t.Y && mx == 0 { - t.Scroll(-4) - return - } else if my == t.Y && mx == t.Width-1 { - t.Scroll(4) - return - } if len(t.List) > 1 { + if my == t.Y && mx == 0 { + t.Scroll(-4) + return + } else if my == t.Y && mx == t.Width-1 { + t.Scroll(4) + return + } + ind := t.LocFromVisual(buffer.Loc{mx, my}) if ind != -1 { t.SetActive(ind)