Skip to content

Commit

Permalink
fix #111
Browse files Browse the repository at this point in the history
emoji frontend now supports east asian ambiguous emojis.
  • Loading branch information
schachmat committed Mar 4, 2017
1 parent 1b0212d commit 3dc651b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion frontends/emoji.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,14 +83,17 @@ func (c *emojiConfig) formatCond(cur []string, cond iface.Cond, current bool) (r
if !ok {
log.Fatalln("emoji-frontend: The following weather code has no icon:", cond.Code)
}
if runewidth.StringWidth(icon) == 1 {
icon += " "
}

desc := cond.Desc
if !current {
desc = runewidth.Truncate(runewidth.FillRight(desc, 13), 13, "…")
}

ret = append(ret, fmt.Sprintf("%v %v %v", cur[0], "", desc))
ret = append(ret, fmt.Sprintf("%v %v %v", cur[1], icon, c.formatTemp(cond)))
ret = append(ret, fmt.Sprintf("%v%v %v", cur[1], icon, c.formatTemp(cond)))
return
}

Expand Down

0 comments on commit 3dc651b

Please sign in to comment.