clean up menu layout

mine
derailed 2019-11-16 16:07:15 -07:00
parent d2fe1250d1
commit 1e9c523b61
1 changed files with 4 additions and 0 deletions

View File

@ -132,9 +132,13 @@ func (v *Menu) layout(table []model.MenuHints, mm []int, out [][]string) {
out[r][c] = keyConv(v.formatMenu(table[r][c], mm[c]))
}
}
}
func (v *Menu) formatMenu(h model.MenuHint, size int) string {
if h.Mnemonic == "" || h.Description == "" {
return ""
}
i, err := strconv.Atoi(h.Mnemonic)
if err == nil {
return formatNSMenu(i, h.Description, v.styles.Frame())