Disable preview follow after dragging the scrollbar

TBD: Should we re-enable follow once the offset reaches the bottom?
This commit is contained in:
Junegunn Choi
2023-01-09 11:07:31 +09:00
parent 80b8846318
commit 4d22b5aaef

View File

@@ -3177,6 +3177,7 @@ func (t *Terminal) Loop() {
y = util.Constrain(y, 0, effectiveHeight-barLength)
// offset = (total - maxItems) * barStart / (maxItems - barLength)
t.previewer.offset = headerLines + int(math.Ceil(float64(y)*float64(numLines-effectiveHeight)/float64(effectiveHeight-barLength)))
t.previewer.following = false
req(reqPreviewRefresh)
}
break