mirror of
https://github.com/jesseduffield/lazygit.git
synced 2026-09-10 07:36:27 -04:00
Store the UI thread ID earlier
This commit is contained in:
parent
87ef96974e
commit
c23bcd6d94
|
|
@ -293,6 +293,12 @@ func NewGui(opts NewGuiOpts) (*Gui, error) {
|
|||
|
||||
g.playRecording = opts.PlayRecording
|
||||
|
||||
// Record the UI thread here, at construction. This assumes NewGui is called
|
||||
// on the same goroutine that will run MainLoop, which holds for all our
|
||||
// callers -- and it means IsUIThread is already correct for the UI work that
|
||||
// runs during startup, before we reach MainLoop.
|
||||
g.uiThreadID.Store(goid.Get())
|
||||
|
||||
return g, nil
|
||||
}
|
||||
|
||||
|
|
@ -977,8 +983,6 @@ func (g *Gui) SetManagerFunc(manager func(*Gui) error) {
|
|||
func (g *Gui) MainLoop() error {
|
||||
defer close(g.loopExited)
|
||||
|
||||
g.uiThreadID.Store(goid.Get())
|
||||
|
||||
go func() {
|
||||
for {
|
||||
select {
|
||||
|
|
|
|||
Loading…
Reference in a new issue