Skip to content

Commit 0a6b32d

Browse files
committed
TabList: HandleEvent: small refactoring
1 parent badaba6 commit 0a6b32d

File tree

1 file changed

+9
-14
lines changed

1 file changed

+9
-14
lines changed

internal/action/tab.go

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -107,23 +107,18 @@ func (t *TabList) HandleEvent(event tcell.Event) {
107107
mx, my := e.Position()
108108
switch e.Buttons() {
109109
case tcell.Button1:
110-
if len(t.List) > 1 {
111-
if my == t.Y && mx == 0 {
110+
if my == t.Y && len(t.List) > 1 {
111+
if mx == 0 {
112112
t.Scroll(-4)
113-
return
114-
} else if my == t.Y && mx == t.Width-1 {
113+
} else if mx == t.Width-1 {
115114
t.Scroll(4)
116-
return
117-
}
118-
119-
ind := t.LocFromVisual(buffer.Loc{mx, my})
120-
if ind != -1 {
121-
t.SetActive(ind)
122-
return
123-
}
124-
if my == 0 {
125-
return
115+
} else {
116+
ind := t.LocFromVisual(buffer.Loc{mx, my})
117+
if ind != -1 {
118+
t.SetActive(ind)
119+
}
126120
}
121+
return
127122
}
128123
case tcell.ButtonNone:
129124
if t.List[t.Active()].release {

0 commit comments

Comments
 (0)