Skip to content

Commit 0a1447b

Browse files
committed
action: tab: Stop resize in case of mouse release while not pressed
1 parent 2ecdac8 commit 0a1447b

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

internal/action/tab.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,12 @@ func (t *TabList) HandleEvent(event tcell.Event) {
124124
return
125125
}
126126
}
127+
case tcell.ButtonNone:
128+
if t.List[t.Active()].release {
129+
// Mouse release received, while already released
130+
t.ResetMouse()
131+
return
132+
}
127133
case tcell.WheelUp:
128134
if my == t.Y {
129135
t.Scroll(4)
@@ -172,6 +178,10 @@ func (t *TabList) SetActive(a int) {
172178
// and the mouse state is still pressed.
173179
func (t *TabList) ResetMouse() {
174180
for _, tab := range t.List {
181+
if !tab.release && tab.resizing != nil {
182+
tab.resizing = nil
183+
}
184+
175185
tab.release = true
176186

177187
for _, p := range tab.Panes {

0 commit comments

Comments
 (0)