From 5cd6f1d06427f1e023573be084e384227fae3cdf Mon Sep 17 00:00:00 2001 From: Junegunn Choi Date: Sun, 1 Jan 2023 14:48:14 +0900 Subject: Add scrollbar Close #3096 --- src/tui/light.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/tui/light.go') diff --git a/src/tui/light.go b/src/tui/light.go index 4225fc52..83020a71 100644 --- a/src/tui/light.go +++ b/src/tui/light.go @@ -176,6 +176,7 @@ func (r *LightRenderer) Init() { if r.mouse { r.csi("?1000h") + r.csi("?1002h") r.csi("?1006h") } r.csi(fmt.Sprintf("%dA", r.MaxY()-1)) @@ -569,12 +570,14 @@ func (r *LightRenderer) mouseSequence(sz *int) Event { // ctrl := t & 0b1000 mod := t&0b1100 > 0 + drag := t&0b100000 > 0 + if scroll != 0 { return Event{Mouse, 0, &MouseEvent{y, x, scroll, false, false, false, mod}} } double := false - if down { + if down && !drag { now := time.Now() if !left { // Right double click is not allowed r.clickY = []int{} -- cgit v1.2.3