mirror of
https://github.com/Llewellynvdm/fzf.git
synced 2024-12-24 11:55:45 +00:00
Avoid unnecessary redraw of the preview window
This commit is contained in:
parent
f39ab3875e
commit
8d2fcd3518
@ -1652,10 +1652,13 @@ 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)
|
||||||
|
if t.previewer.offset != newOffset {
|
||||||
|
t.previewer.offset = newOffset
|
||||||
req(reqPreviewRefresh)
|
req(reqPreviewRefresh)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
for key, ret := range t.expect {
|
for key, ret := range t.expect {
|
||||||
if keyMatch(key, event) {
|
if keyMatch(key, event) {
|
||||||
t.pressed = ret
|
t.pressed = ret
|
||||||
|
Loading…
Reference in New Issue
Block a user