diff options
author | Michael Muré <batolettre@gmail.com> | 2020-02-25 19:40:07 +0100 |
---|---|---|
committer | Michael Muré <batolettre@gmail.com> | 2020-02-25 19:40:07 +0100 |
commit | a322721a114e41a0ef0912606faad81780dcc357 (patch) | |
tree | 398b1369427f5795b37c908d63151b50ffd52df5 /termui | |
parent | 8ef6438fb476e9d510a39ead321cbeee6288e2d2 (diff) | |
download | git-bug-a322721a114e41a0ef0912606faad81780dcc357.tar.gz |
termui: fix label cropped in the label edition window
Diffstat (limited to 'termui')
-rw-r--r-- | termui/label_select.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/termui/label_select.go b/termui/label_select.go index a05d9c8b..3208371d 100644 --- a/termui/label_select.go +++ b/termui/label_select.go @@ -100,7 +100,7 @@ func (ls *labelSelect) layout(g *gocui.Gui) error { width := 5 for _, label := range ls.labels { - width = maxInt(width, len(label)) + width = maxInt(width, len(label.String())) } width += 10 x0 := 1 @@ -116,8 +116,8 @@ func (ls *labelSelect) layout(g *gocui.Gui) error { } for i, label := range ls.labels { - viewname := fmt.Sprintf("view%d", i) - v, err := g.SetView(viewname, x0+2, y0, x0+width-2, y0+2, 0) + viewname := fmt.Sprintf("labeledit%d", i) + v, err := g.SetView(viewname, x0+2, y0, x0+width+2, y0+2, 0) if err != nil && !gocui.IsUnknownView(err) { return err } @@ -176,7 +176,7 @@ func (ls *labelSelect) focusView(g *gocui.Gui) error { return err } - _, vy0, _, vy1, err := g.ViewPosition(fmt.Sprintf("view%d", ls.selected)) + _, vy0, _, vy1, err := g.ViewPosition(fmt.Sprintf("labeledit%d", ls.selected)) if err != nil { return err } |