Skip to content
Myr

Fix info not updated after track-current is disabled due to race condition

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Junegunn Choi · committed by Junegunn Choi · parent 998c574 · Browse files · 1 file+6 added−11 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+6 added−11 removed

  • other:+6 added−11 removed

1 file+6 added−11 removed

modified:src/terminal.go+6 added-11 removed
4623 unmodified lines
4624 // L t.mutex | U t.uiMutex4625 // U t.uiMutex |4626 t.uiMutex.Lock()4627 t.mutex.Lock()4628 printInfo := util.RunOnce(func() {4629 if !t.resizeIfNeeded() {4630 t.printInfo()4631 }4632 })4628 info := false4629 for _, key := range keys {4630 req := util.EventType(key)4631 value := (*events)[req]4632 switch req {4633 case reqPrompt:4634 t.printPrompt()4635 if t.infoStyle == infoInline || t.infoStyle == infoInlineRight {4640 printInfo()4636 info = true4637 }4638 case reqInfo:4643 printInfo()4639 info = true4640 case reqList:4641 t.printList()4642 currentIndex := t.currentIndex()4643 focusChanged := focusedIndex != currentIndex4648 info := false4644 if focusChanged && focusedIndex >= 0 && t.track == trackCurrent {4645 t.track = trackDisabled4646 info = true4647 }
3 unmodified lines
4651 if t.infoCommand != "" {4652 info = true4653 }4654 }4660 if info {4661 printInfo()4662 }4655 if focusChanged || version != t.version {4656 version = t.version4657 focusedIndex = currentIndex4658 refreshPreview(t.previewOpts.command)
83 unmodified lines
4742 exit(func() int { return ExitError })4743 return4744 }4745 }4746 if info && !t.resizeIfNeeded() {4747 t.printInfo()4748 }4749 t.flush()4750 t.mutex.Unlock()4751 t.uiMutex.Unlock()4752 })
1577 unmodified lines