Skip to content

Commit 602acff

Browse files
committed
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.
1 parent ced6d94 commit 602acff

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

internal/action/tab.go

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -107,14 +107,15 @@ func (t *TabList) HandleEvent(event tcell.Event) {
107107
mx, my := e.Position()
108108
switch e.Buttons() {
109109
case tcell.Button1:
110-
if my == t.Y && mx == 0 {
111-
t.Scroll(-4)
112-
return
113-
} else if my == t.Y && mx == t.Width-1 {
114-
t.Scroll(4)
115-
return
116-
}
117110
if len(t.List) > 1 {
111+
if my == t.Y && mx == 0 {
112+
t.Scroll(-4)
113+
return
114+
} else if my == t.Y && mx == t.Width-1 {
115+
t.Scroll(4)
116+
return
117+
}
118+
118119
ind := t.LocFromVisual(buffer.Loc{mx, my})
119120
if ind != -1 {
120121
t.SetActive(ind)

0 commit comments

Comments
 (0)