mirror of
https://github.com/jesseduffield/lazygit.git
synced 2026-11-21 04:46:29 +03:00
Store the UI thread ID earlier
This commit is contained in:
1 parent
87ef96974e
commit
c23bcd6d94
1 file changed
+6
-2
+6
-2
@@ -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 {
|
||||
|
||||
Reference in new issue
Block a user