This commit is contained in:
Daniel 2025-02-15 18:26:40 +08:00
parent c3bc804fce
commit 4374859e04
No known key found for this signature in database
GPG key ID: 86211BA83DF03017
2 changed files with 12 additions and 5 deletions

View file

@ -691,7 +691,15 @@ func Close(force, setCurrentWorkspace bool, execInstallPkg int) (exitCode int) {
return
}
var CustomEmojis = sync.Map{}
var customEmojis = sync.Map{}
func AddCustomEmoji(emojiName, imgSrc string) {
customEmojis.Store(emojiName, imgSrc)
}
func ClearCustomEmojis() {
customEmojis.Clear()
}
func NewLute() (ret *lute.Lute) {
ret = util.NewLute()
@ -701,7 +709,7 @@ func NewLute() (ret *lute.Lute) {
ret.SetSpellcheck(Conf.Editor.Spellcheck)
customEmojiMap := map[string]string{}
CustomEmojis.Range(func(key, value interface{}) bool {
customEmojis.Range(func(key, value interface{}) bool {
customEmojiMap[key.(string)] = value.(string)
return true
})