mirror of
https://github.com/junegunn/fzf.git
synced 2025-05-19 04:40:22 -07:00
Fix info not updated after track-current is disabled due to race condition
This commit is contained in:
parent
998c57442b
commit
dac5b6fde1
@ -4625,11 +4625,7 @@ func (t *Terminal) Loop() error {
|
|||||||
// U t.uiMutex |
|
// U t.uiMutex |
|
||||||
t.uiMutex.Lock()
|
t.uiMutex.Lock()
|
||||||
t.mutex.Lock()
|
t.mutex.Lock()
|
||||||
printInfo := util.RunOnce(func() {
|
info := false
|
||||||
if !t.resizeIfNeeded() {
|
|
||||||
t.printInfo()
|
|
||||||
}
|
|
||||||
})
|
|
||||||
for _, key := range keys {
|
for _, key := range keys {
|
||||||
req := util.EventType(key)
|
req := util.EventType(key)
|
||||||
value := (*events)[req]
|
value := (*events)[req]
|
||||||
@ -4637,15 +4633,14 @@ func (t *Terminal) Loop() error {
|
|||||||
case reqPrompt:
|
case reqPrompt:
|
||||||
t.printPrompt()
|
t.printPrompt()
|
||||||
if t.infoStyle == infoInline || t.infoStyle == infoInlineRight {
|
if t.infoStyle == infoInline || t.infoStyle == infoInlineRight {
|
||||||
printInfo()
|
info = true
|
||||||
}
|
}
|
||||||
case reqInfo:
|
case reqInfo:
|
||||||
printInfo()
|
info = true
|
||||||
case reqList:
|
case reqList:
|
||||||
t.printList()
|
t.printList()
|
||||||
currentIndex := t.currentIndex()
|
currentIndex := t.currentIndex()
|
||||||
focusChanged := focusedIndex != currentIndex
|
focusChanged := focusedIndex != currentIndex
|
||||||
info := false
|
|
||||||
if focusChanged && focusedIndex >= 0 && t.track == trackCurrent {
|
if focusChanged && focusedIndex >= 0 && t.track == trackCurrent {
|
||||||
t.track = trackDisabled
|
t.track = trackDisabled
|
||||||
info = true
|
info = true
|
||||||
@ -4657,9 +4652,6 @@ func (t *Terminal) Loop() error {
|
|||||||
info = true
|
info = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if info {
|
|
||||||
printInfo()
|
|
||||||
}
|
|
||||||
if focusChanged || version != t.version {
|
if focusChanged || version != t.version {
|
||||||
version = t.version
|
version = t.version
|
||||||
focusedIndex = currentIndex
|
focusedIndex = currentIndex
|
||||||
@ -4751,6 +4743,9 @@ func (t *Terminal) Loop() error {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if info && !t.resizeIfNeeded() {
|
||||||
|
t.printInfo()
|
||||||
|
}
|
||||||
t.flush()
|
t.flush()
|
||||||
t.mutex.Unlock()
|
t.mutex.Unlock()
|
||||||
t.uiMutex.Unlock()
|
t.uiMutex.Unlock()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user