From 0a1447b6886ac2b459a1037f555e949c16c566df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6ran=20Karl?= <3951388+JoeKar@users.noreply.github.com> Date: Thu, 25 Apr 2024 22:53:56 +0200 Subject: [PATCH] action: tab: Stop resize in case of mouse release while not pressed --- internal/action/tab.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/internal/action/tab.go b/internal/action/tab.go index 061bfbb9..2a1f5a62 100644 --- a/internal/action/tab.go +++ b/internal/action/tab.go @@ -124,6 +124,12 @@ func (t *TabList) HandleEvent(event tcell.Event) { return } } + case tcell.ButtonNone: + if t.List[t.Active()].release { + // Mouse release received, while already released + t.ResetMouse() + return + } case tcell.WheelUp: if my == t.Y { t.Scroll(4) @@ -172,6 +178,10 @@ func (t *TabList) SetActive(a int) { // and the mouse state is still pressed. func (t *TabList) ResetMouse() { for _, tab := range t.List { + if !tab.release && tab.resizing != nil { + tab.resizing = nil + } + tab.release = true for _, p := range tab.Panes {