all repos — mx @ 4ae2f6e2c20f22ebb6b3d478313dce9a89c870e6

work in progress MUA

Fix WidthMaxEnforcer
Anirudh Oppiliappan x@icyphox.sh
Thu, 08 Jul 2021 10:59:25 +0530
commit

4ae2f6e2c20f22ebb6b3d478313dce9a89c870e6

parent

403e2401a361d5108e6646ad2c1c740d99bf77fb

4 files changed, 8 insertions(+), 12 deletions(-)

jump to
M commands/list.gocommands/list.go

@@ -9,7 +9,6 @@ "time"

gomaildir "github.com/emersion/go-maildir" "github.com/jedib0t/go-pretty/v6/table" - "github.com/jedib0t/go-pretty/v6/text" "git.icyphox.sh/mx/config" "git.icyphox.sh/mx/maildir"

@@ -75,13 +74,10 @@ if err != nil {

return nil, err } - // TODO: remove text.Trim and have this configured in column - // config (WidthMaxEnforcer) - // ref: https://github.com/jedib0t/go-pretty/issues/170 if len(addr.Name) > 0 { - ll.from = text.Trim(addr.Name, 20) + ll.from = addr.Name } else { - ll.from = text.Trim(addr.Address, 20) + ll.from = addr.Address } ll.date = date ll.flags = strflags
M commands/table.gocommands/table.go

@@ -36,9 +36,9 @@ TopSeparator: " ",

UnfinishedRow: "", }, }) - // t.SetColumnConfigs([]table.ColumnConfig{ - // {Number: 3, WidthMax: 25, WidthMaxEnforcer: text.Trim}, - // }) + t.SetColumnConfigs([]table.ColumnConfig{ + {Number: 3, WidthMax: 20, WidthMaxEnforcer: text.Trim}, + }) t.SetAllowedRowLength(w) return t }
M go.modgo.mod

@@ -4,7 +4,7 @@ go 1.16

require ( github.com/emersion/go-maildir v0.2.0 - github.com/jedib0t/go-pretty/v6 v6.2.2 + github.com/jedib0t/go-pretty/v6 v6.2.3 github.com/peterh/liner v1.2.1 golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c gopkg.in/yaml.v2 v2.4.0
M go.sumgo.sum

@@ -3,8 +3,8 @@ github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=

github.com/emersion/go-maildir v0.2.0 h1:fC4+UVGl8GcQGbFF7AWab2JMf4VbKz+bMNv07xxhzs8= github.com/emersion/go-maildir v0.2.0/go.mod h1:I2j27lND/SRLgxROe50Vam81MSaqPFvJ0OHNnDZ7n84= github.com/fzipp/gocyclo v0.3.1/go.mod h1:DJHO6AUmbdqj2ET4Z9iArSuwWgYDRryYt2wASxc7x3E= -github.com/jedib0t/go-pretty/v6 v6.2.2 h1:o3McN0rQ4X+IU+HduppSp9TwRdGLRW2rhJXy9CJaCRw= -github.com/jedib0t/go-pretty/v6 v6.2.2/go.mod h1:+nE9fyyHGil+PuISTCrp7avEdo6bqoMwqZnuiK2r2a0= +github.com/jedib0t/go-pretty/v6 v6.2.3 h1:Uxw6fC4zJ/vXtcSTq+5H3fof1icvhuJ6QjosHh+U6AU= +github.com/jedib0t/go-pretty/v6 v6.2.3/go.mod h1:+nE9fyyHGil+PuISTCrp7avEdo6bqoMwqZnuiK2r2a0= github.com/mattn/go-runewidth v0.0.3/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= github.com/mattn/go-runewidth v0.0.9 h1:Lm995f3rfxdpd6TSmuVCHVb/QhupuXlYr8sCI/QdE+0= github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI=