mirror of
https://github.com/kovidgoyal/kitty.git
synced 2024-09-11 14:45:31 +03:00
Fix a regression in the previous release that broke usage of custom themes
Fixes #6191
This commit is contained in:
parent
b966013a2b
commit
a09464dee9
@ -42,6 +42,8 @@ Detailed list of changes
|
||||
|
||||
- Fix a regression in the previous release that broke handling of some key board shortcuts in some kittens on some keyboard layouts (:iss:`6189`)
|
||||
|
||||
- Fix a regression in the previous release that broke usage of custom themes (:iss:`6191`)
|
||||
|
||||
0.28.0 [2023-04-15]
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
|
@ -532,10 +532,11 @@ func parse_theme_metadata(path string) (*ThemeMetadata, map[string]string, error
|
||||
type Theme struct {
|
||||
metadata *ThemeMetadata
|
||||
|
||||
code string
|
||||
settings map[string]string
|
||||
zip_reader *zip.File
|
||||
is_user_defined bool
|
||||
code string
|
||||
settings map[string]string
|
||||
zip_reader *zip.File
|
||||
is_user_defined bool
|
||||
path_for_user_defined_theme string
|
||||
}
|
||||
|
||||
func (self *Theme) Name() string { return self.metadata.Name }
|
||||
@ -558,6 +559,13 @@ func (self *Theme) load_code() (string, error) {
|
||||
}
|
||||
self.code = utils.UnsafeBytesToString(data)
|
||||
}
|
||||
if self.is_user_defined && self.path_for_user_defined_theme != "" && self.code == "" {
|
||||
raw, err := os.ReadFile(self.path_for_user_defined_theme)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
self.code = utils.UnsafeBytesToString(raw)
|
||||
}
|
||||
return self.code, nil
|
||||
}
|
||||
|
||||
@ -813,7 +821,7 @@ func (self *Themes) AddFromFile(path string) (*Theme, error) {
|
||||
if m.Name == "" {
|
||||
m.Name = theme_name_from_file_name(filepath.Base(path))
|
||||
}
|
||||
t := Theme{metadata: m, is_user_defined: true, settings: conf}
|
||||
t := Theme{metadata: m, is_user_defined: true, settings: conf, path_for_user_defined_theme: path}
|
||||
self.name_map[m.Name] = &t
|
||||
return &t, nil
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user