mirror of
https://github.com/jesseduffield/lazygit.git
synced 2026-09-10 15:46:26 -04:00
Set the view color on the UI thread too
Unrelated to this branch, just because we're touching this code: there's little reason to set the color on the background thread but the text on the UI thread. Set them both together on the UI thread. Avoids a data race (unlikely to be a problem in practice, we're talking about a 64-bit int, but still).
This commit is contained in:
parent
670565c175
commit
79440c0945
|
|
@ -97,7 +97,6 @@ func (self *AppStatusHelper) renderAppStatus() {
|
|||
prevAppStatus := ""
|
||||
for range ticker.C {
|
||||
appStatus, color := self.statusMgr().GetStatusString(self.c.UserConfig())
|
||||
self.c.Views().AppStatus.FgColor = color
|
||||
|
||||
update := self.c.OnUIThreadContentOnly
|
||||
if utils.StringWidth(appStatus) != utils.StringWidth(prevAppStatus) {
|
||||
|
|
@ -108,6 +107,7 @@ func (self *AppStatusHelper) renderAppStatus() {
|
|||
update = self.c.OnUIThread
|
||||
}
|
||||
update(func() error {
|
||||
self.c.Views().AppStatus.FgColor = color
|
||||
self.c.SetViewContent(self.c.Views().AppStatus, appStatus)
|
||||
return nil
|
||||
})
|
||||
|
|
|
|||
Loading…
Reference in a new issue