mirror of
https://github.com/Llewellynvdm/fzf.git
synced 2024-12-23 19:39:07 +00:00
Avoid unnecessary update of search progress
This commit is contained in:
parent
1c31352675
commit
1db68a3976
@ -94,9 +94,14 @@ func (t *Terminal) UpdateCount(cnt int, final bool) {
|
|||||||
|
|
||||||
func (t *Terminal) UpdateProgress(progress float32) {
|
func (t *Terminal) UpdateProgress(progress float32) {
|
||||||
t.mutex.Lock()
|
t.mutex.Lock()
|
||||||
t.progress = int(progress * 100)
|
newProgress := int(progress * 100)
|
||||||
|
changed := t.progress != newProgress
|
||||||
|
t.progress = newProgress
|
||||||
t.mutex.Unlock()
|
t.mutex.Unlock()
|
||||||
|
|
||||||
|
if changed {
|
||||||
t.reqBox.Set(REQ_INFO, nil)
|
t.reqBox.Set(REQ_INFO, nil)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (t *Terminal) UpdateList(merger *Merger) {
|
func (t *Terminal) UpdateList(merger *Merger) {
|
||||||
|
Loading…
Reference in New Issue
Block a user