1
0
mirror of https://github.com/alecthomas/chroma.git synced 2025-11-27 22:38:42 +02:00

fix: synthesisable entries are ignored when cloned (#465)

This commit is contained in:
Zhangyuan Nie
2021-04-11 01:06:10 -04:00
committed by GitHub
parent 41b886a7fd
commit d67a2bfdc2
2 changed files with 18 additions and 3 deletions

View File

@@ -265,12 +265,12 @@ func (s *Style) Get(ttype TokenType) StyleEntry {
func (s *Style) get(ttype TokenType) StyleEntry {
out := s.entries[ttype]
if out.IsZero() && s.synthesisable(ttype) {
out = s.synthesise(ttype)
}
if out.IsZero() && s.parent != nil {
return s.parent.get(ttype)
}
if out.IsZero() && s.synthesisable(ttype) {
out = s.synthesise(ttype)
}
return out
}