mirror of
https://github.com/JanDeDobbeleer/oh-my-posh.git
synced 2025-02-02 05:41:10 -08:00
fix(image): set font cache before usage
This commit is contained in:
parent
caece11225
commit
da74c2b27c
|
@ -350,6 +350,10 @@ func (m *main) View() string {
|
||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func SetCache(c cache_.Cache) {
|
||||||
|
cache = c
|
||||||
|
}
|
||||||
|
|
||||||
func Run(font string, ch cache_.Cache, root bool, zipFolder string) {
|
func Run(font string, ch cache_.Cache, root bool, zipFolder string) {
|
||||||
main := &main{
|
main := &main{
|
||||||
system: root,
|
system: root,
|
||||||
|
@ -360,7 +364,7 @@ func Run(font string, ch cache_.Cache, root bool, zipFolder string) {
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
cache = ch
|
SetCache(ch)
|
||||||
|
|
||||||
program = tea.NewProgram(main)
|
program = tea.NewProgram(main)
|
||||||
if _, err := program.Run(); err != nil {
|
if _, err := program.Run(); err != nil {
|
||||||
|
|
|
@ -145,6 +145,8 @@ func (ir *Renderer) Init(env runtime.Environment) error {
|
||||||
|
|
||||||
ir.cleanContent()
|
ir.cleanContent()
|
||||||
|
|
||||||
|
font_.SetCache(env.Cache())
|
||||||
|
|
||||||
if err := ir.loadFonts(); err != nil {
|
if err := ir.loadFonts(); err != nil {
|
||||||
return &ConnectionError{reason: err.Error()}
|
return &ConnectionError{reason: err.Error()}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue