aboutsummaryrefslogtreecommitdiffstats
path: root/termui
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2020-02-25 19:40:07 +0100
committerMichael Muré <batolettre@gmail.com>2020-02-25 19:40:07 +0100
commita322721a114e41a0ef0912606faad81780dcc357 (patch)
tree398b1369427f5795b37c908d63151b50ffd52df5 /termui
parent8ef6438fb476e9d510a39ead321cbeee6288e2d2 (diff)
downloadgit-bug-a322721a114e41a0ef0912606faad81780dcc357.tar.gz
termui: fix label cropped in the label edition window
Diffstat (limited to 'termui')
-rw-r--r--termui/label_select.go8
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
}