mirror of
https://github.com/JanDeDobbeleer/oh-my-posh.git
synced 2024-12-25 19:14:50 -08:00
fix(image): set font cache before usage
This commit is contained in:
parent
caece11225
commit
30c914f65c
|
@ -350,6 +350,10 @@ func (m *main) View() string {
|
|||
return ""
|
||||
}
|
||||
|
||||
func SetCache(c cache_.Cache) {
|
||||
cache = c
|
||||
}
|
||||
|
||||
func Run(font string, ch cache_.Cache, root bool, zipFolder string) {
|
||||
main := &main{
|
||||
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)
|
||||
if _, err := program.Run(); err != nil {
|
||||
|
|
|
@ -145,6 +145,8 @@ func (ir *Renderer) Init(env runtime.Environment) error {
|
|||
|
||||
ir.cleanContent()
|
||||
|
||||
font_.SetCache(env.Cache())
|
||||
|
||||
if err := ir.loadFonts(); err != nil {
|
||||
return &ConnectionError{reason: err.Error()}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue