File tree Expand file tree Collapse file tree 1 file changed +13
-17
lines changed
Expand file tree Collapse file tree 1 file changed +13
-17
lines changed Original file line number Diff line number Diff line change @@ -107,22 +107,18 @@ 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- }
117- if len (t .List ) > 1 {
118- ind := t .LocFromVisual (buffer.Loc {mx , my })
119- if ind != - 1 {
120- t .SetActive (ind )
121- return
122- }
123- if my == 0 {
124- return
110+ if my == t .Y && len (t .List ) > 1 {
111+ if mx == 0 {
112+ t .Scroll (- 4 )
113+ } else if mx == t .Width - 1 {
114+ t .Scroll (4 )
115+ } else {
116+ ind := t .LocFromVisual (buffer.Loc {mx , my })
117+ if ind != - 1 {
118+ t .SetActive (ind )
119+ }
125120 }
121+ return
126122 }
127123 case tcell .ButtonNone :
128124 if t .List [t .Active ()].release {
@@ -131,12 +127,12 @@ func (t *TabList) HandleEvent(event tcell.Event) {
131127 return
132128 }
133129 case tcell .WheelUp :
134- if my == t .Y {
130+ if my == t .Y && len ( t . List ) > 1 {
135131 t .Scroll (4 )
136132 return
137133 }
138134 case tcell .WheelDown :
139- if my == t .Y {
135+ if my == t .Y && len ( t . List ) > 1 {
140136 t .Scroll (- 4 )
141137 return
142138 }
You can’t perform that action at this time.
0 commit comments