Fix tree generation breaking subtrees
This commit is contained in:
parent
b32820410d
commit
33cbf9f25f
1 changed files with 6 additions and 4 deletions
10
emoji.go
10
emoji.go
|
@ -49,7 +49,8 @@ func (em emojiTable) Find(str string) *emoji {
|
|||
}
|
||||
// Check if there are more bytes to check
|
||||
if len(str) > i && e.Sub != nil {
|
||||
newemj := e.Sub.Find(str[i:])
|
||||
rlen := utf8.RuneLen(r)
|
||||
newemj := e.Sub.Find(str[i+rlen:])
|
||||
if newemj != nil {
|
||||
return newemj
|
||||
}
|
||||
|
@ -130,13 +131,14 @@ func scanEmojiDirectory(emojipath string) (tab emojiTable, err error) {
|
|||
newemo.IsEmoji = true
|
||||
newemo.Path = path
|
||||
} else {
|
||||
// Add sub-entry
|
||||
newemo.Sub = make(emojiTable)
|
||||
// Add sub-entry if not existant
|
||||
if newemo.Sub == nil {
|
||||
newemo.Sub = make(emojiTable)
|
||||
}
|
||||
}
|
||||
(*curtab)[cprune] = newemo
|
||||
curtab = &newemo.Sub
|
||||
}
|
||||
fmt.Println(codepointstr)
|
||||
return nil
|
||||
})
|
||||
return tab, err
|
||||
|
|
Loading…
Reference in a new issue