mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-08 21:25:32 +02:00
Merge branch 'fix/choose-fonts-color-race' of https://github.com/noctilust/kitty
This commit is contained in:
@@ -52,6 +52,9 @@ func (self *faces) draw_screen() (err error) {
|
||||
previews, found := self.preview_cache[key]
|
||||
if !found {
|
||||
self.preview_cache[key] = make(map[string]RenderedSampleTransmit)
|
||||
if self.handler.text_style.Foreground == "" || self.handler.text_style.Background == "" {
|
||||
return
|
||||
}
|
||||
go func() {
|
||||
var r map[string]RenderedSampleTransmit
|
||||
s := key.settings
|
||||
|
||||
@@ -122,7 +122,7 @@ func (self *FontList) draw_family_summary(start_x int, sz loop.ScreenSize) (err
|
||||
lp.QueueWriteString(line)
|
||||
y++
|
||||
}
|
||||
if self.handler.text_style.Background != "" {
|
||||
if self.handler.text_style.Foreground != "" && self.handler.text_style.Background != "" {
|
||||
return self.draw_preview(start_x, y, sz)
|
||||
}
|
||||
return
|
||||
|
||||
@@ -139,9 +139,14 @@ func (h *handler) on_query_response(key, val string, valid bool) error {
|
||||
}
|
||||
case "foreground":
|
||||
h.text_style.Foreground = val
|
||||
if h.text_style.Background != "" {
|
||||
return h.draw_screen()
|
||||
}
|
||||
case "background":
|
||||
h.text_style.Background = val
|
||||
return h.draw_screen()
|
||||
if h.text_style.Foreground != "" {
|
||||
return h.draw_screen()
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user