Fix double-click on light renderer

This commit is contained in:
Junegunn Choi 2023-01-03 01:39:16 +09:00
parent ec471a5bc2
commit 1fc1f47d80
No known key found for this signature in database
GPG Key ID: 254BC280FEF9C627

View File

@ -588,7 +588,8 @@ func (r *LightRenderer) mouseSequence(sz *int) Event {
}
r.prevDownTime = now
} else {
if len(r.clicks) > 1 && r.clicks[0][0] == r.clicks[1][0] && r.clicks[0][1] == r.clicks[1][1] &&
n := len(r.clicks)
if len(r.clicks) > 1 && r.clicks[n-2][0] == r.clicks[n-1][0] && r.clicks[n-2][1] == r.clicks[n-1][1] &&
time.Since(r.prevDownTime) < doubleClickDuration {
double = true
if double {