diff options
| author | Junegunn Choi <junegunn.c@gmail.com> | 2015-01-11 21:56:55 +0900 |
|---|---|---|
| committer | Junegunn Choi <junegunn.c@gmail.com> | 2015-01-11 21:56:55 +0900 |
| commit | 1db68a3976cfb10ed7d6ab88d7b468bb1b93ee34 (patch) | |
| tree | 7157377a291419e3b12049f80bfb209a6f96d80d /src | |
| parent | 1c313526753c1ad48b11574883c70bd850af78d1 (diff) | |
| download | fzf-1db68a3976cfb10ed7d6ab88d7b468bb1b93ee34.tar.gz | |
Avoid unnecessary update of search progress
Diffstat (limited to 'src')
| -rw-r--r-- | src/terminal.go | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/terminal.go b/src/terminal.go index 7039e57c..7d8bc5b2 100644 --- a/src/terminal.go +++ b/src/terminal.go @@ -94,9 +94,14 @@ func (t *Terminal) UpdateCount(cnt int, final bool) { func (t *Terminal) UpdateProgress(progress float32) { t.mutex.Lock() - t.progress = int(progress * 100) + newProgress := int(progress * 100) + changed := t.progress != newProgress + t.progress = newProgress t.mutex.Unlock() - t.reqBox.Set(REQ_INFO, nil) + + if changed { + t.reqBox.Set(REQ_INFO, nil) + } } func (t *Terminal) UpdateList(merger *Merger) { |
