mirror of
https://github.com/zyedidia/micro.git
synced 2026-03-22 00:37:12 +09:00
TabList: HandleEvent: small refactoring
This commit is contained in:
@@ -107,23 +107,18 @@ func (t *TabList) HandleEvent(event tcell.Event) {
|
||||
mx, my := e.Position()
|
||||
switch e.Buttons() {
|
||||
case tcell.Button1:
|
||||
if len(t.List) > 1 {
|
||||
if my == t.Y && mx == 0 {
|
||||
if my == t.Y && len(t.List) > 1 {
|
||||
if mx == 0 {
|
||||
t.Scroll(-4)
|
||||
return
|
||||
} else if my == t.Y && mx == t.Width-1 {
|
||||
} else if mx == t.Width-1 {
|
||||
t.Scroll(4)
|
||||
return
|
||||
}
|
||||
|
||||
ind := t.LocFromVisual(buffer.Loc{mx, my})
|
||||
if ind != -1 {
|
||||
t.SetActive(ind)
|
||||
return
|
||||
}
|
||||
if my == 0 {
|
||||
return
|
||||
} else {
|
||||
ind := t.LocFromVisual(buffer.Loc{mx, my})
|
||||
if ind != -1 {
|
||||
t.SetActive(ind)
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
case tcell.ButtonNone:
|
||||
if t.List[t.Active()].release {
|
||||
|
||||
Reference in New Issue
Block a user