mirror of
https://github.com/Llewellynvdm/fzf.git
synced 2024-12-24 11:55:45 +00:00
Redraw prompt only when necessary
This commit is contained in:
parent
82efe6c60d
commit
f39ab3875e
@ -1635,7 +1635,8 @@ func (t *Terminal) Loop() {
|
|||||||
|
|
||||||
t.mutex.Lock()
|
t.mutex.Lock()
|
||||||
previousInput := t.input
|
previousInput := t.input
|
||||||
events := []util.EventType{reqPrompt}
|
previousCx := t.cx
|
||||||
|
events := []util.EventType{}
|
||||||
req := func(evts ...util.EventType) {
|
req := func(evts ...util.EventType) {
|
||||||
for _, event := range evts {
|
for _, event := range evts {
|
||||||
events = append(events, event)
|
events = append(events, event)
|
||||||
@ -1996,7 +1997,6 @@ func (t *Terminal) Loop() {
|
|||||||
t.jumping = jumpDisabled
|
t.jumping = jumpDisabled
|
||||||
req(reqList)
|
req(reqList)
|
||||||
}
|
}
|
||||||
t.mutex.Unlock() // Must be unlocked before touching reqBox
|
|
||||||
|
|
||||||
if changed {
|
if changed {
|
||||||
if t.isPreviewEnabled() {
|
if t.isPreviewEnabled() {
|
||||||
@ -2007,6 +2007,12 @@ func (t *Terminal) Loop() {
|
|||||||
}
|
}
|
||||||
t.eventBox.Set(EvtSearchNew, t.sort)
|
t.eventBox.Set(EvtSearchNew, t.sort)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if changed || t.cx != previousCx {
|
||||||
|
req(reqPrompt)
|
||||||
|
}
|
||||||
|
|
||||||
|
t.mutex.Unlock() // Must be unlocked before touching reqBox
|
||||||
for _, event := range events {
|
for _, event := range events {
|
||||||
t.reqBox.Set(event, nil)
|
t.reqBox.Set(event, nil)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user