mirror of
https://github.com/Llewellynvdm/fzf.git
synced 2024-12-23 19:39:07 +00:00
Avoid unnecessary redraw of the preview window
This commit is contained in:
parent
f39ab3875e
commit
8d2fcd3518
@ -1652,9 +1652,12 @@ func (t *Terminal) Loop() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
scrollPreview := func(amount int) {
|
scrollPreview := func(amount int) {
|
||||||
t.previewer.offset = util.Constrain(
|
newOffset := util.Constrain(
|
||||||
t.previewer.offset+amount, 0, t.previewer.lines-1)
|
t.previewer.offset+amount, 0, t.previewer.lines-1)
|
||||||
req(reqPreviewRefresh)
|
if t.previewer.offset != newOffset {
|
||||||
|
t.previewer.offset = newOffset
|
||||||
|
req(reqPreviewRefresh)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
for key, ret := range t.expect {
|
for key, ret := range t.expect {
|
||||||
if keyMatch(key, event) {
|
if keyMatch(key, event) {
|
||||||
|
Loading…
Reference in New Issue
Block a user