From 3ad2fdd36a8cde8ff312f41bea086f442bb5f29f Mon Sep 17 00:00:00 2001 From: Trevor Slocum Date: Wed, 14 Oct 2020 13:50:36 -0700 Subject: [PATCH] Clarify that Table rows must each have the same number of columns --- CHANGELOG | 1 + go.mod | 4 ++-- go.sum | 8 ++++---- table.go | 4 ++++ 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index f9ddf10..7699471 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -8,6 +8,7 @@ v1.5.1 (WIP) - Fix List dividers allowing selection - Allow modification of scroll bar render text - Allow scrolling List horizontally +- Clarify that Table rows must each have the same number of columns - Make printWithStyle public and rename as PrintStyle - Optimize TextView (writing is 90% faster, drawing is 50% faster) - Remove return values from methods which return their primitive (breaks chaining) diff --git a/go.mod b/go.mod index 171478e..791dd41 100644 --- a/go.mod +++ b/go.mod @@ -3,10 +3,10 @@ module gitlab.com/tslocum/cview go 1.12 require ( - github.com/gdamore/tcell/v2 v2.0.0-dev.0.20200926152101-0fb77ddaa5b4 + github.com/gdamore/tcell/v2 v2.0.0-dev.0.20201014051707-aeb3a1194825 github.com/lucasb-eyer/go-colorful v1.0.3 github.com/mattn/go-runewidth v0.0.9 github.com/rivo/uniseg v0.1.0 gitlab.com/tslocum/cbind v0.1.2 - golang.org/x/sys v0.0.0-20201013132646-2da7054afaeb // indirect + golang.org/x/sys v0.0.0-20201014080544-cc95f250f6bc // indirect ) diff --git a/go.sum b/go.sum index 600ba9b..f3d09e9 100644 --- a/go.sum +++ b/go.sum @@ -1,8 +1,8 @@ github.com/gdamore/encoding v1.0.0 h1:+7OoQ1Bc6eTm5niUzBa0Ctsh6JbMW6Ra+YNuAtDBdko= github.com/gdamore/encoding v1.0.0/go.mod h1:alR0ol34c49FCSBLjhosxzcPHQbf2trDkoo5dl+VrEg= github.com/gdamore/tcell/v2 v2.0.0-dev/go.mod h1:vSVL/GV5mCSlPC6thFP5kfOFdM9MGZcalipmpTxTgQA= -github.com/gdamore/tcell/v2 v2.0.0-dev.0.20200926152101-0fb77ddaa5b4 h1:9WLVV5c2UI2qvgROlgzLgCuK5gi7igcU5LNsPXCSFB8= -github.com/gdamore/tcell/v2 v2.0.0-dev.0.20200926152101-0fb77ddaa5b4/go.mod h1:vSVL/GV5mCSlPC6thFP5kfOFdM9MGZcalipmpTxTgQA= +github.com/gdamore/tcell/v2 v2.0.0-dev.0.20201014051707-aeb3a1194825 h1:PniILgKHAXM1OsfAsUoxnmeaH2DNk67W9degA+x4Byc= +github.com/gdamore/tcell/v2 v2.0.0-dev.0.20201014051707-aeb3a1194825/go.mod h1:vSVL/GV5mCSlPC6thFP5kfOFdM9MGZcalipmpTxTgQA= github.com/lucasb-eyer/go-colorful v1.0.3 h1:QIbQXiugsb+q10B+MI+7DI1oQLdmnep86tWFlaaUAac= github.com/lucasb-eyer/go-colorful v1.0.3/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i7ruzyGqttikkLy0= github.com/mattn/go-runewidth v0.0.7/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= @@ -15,8 +15,8 @@ gitlab.com/tslocum/cbind v0.1.2/go.mod h1:HfB7qAhHSZbn1rFK8M9SvSN5NG6ScAg/3h3iE6 golang.org/x/sys v0.0.0-20190626150813-e07cf5db2756/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200826173525-f9321e4c35a6 h1:DvY3Zkh7KabQE/kfzMvYvKirSiguP9Q/veMtkYyf0o8= golang.org/x/sys v0.0.0-20200826173525-f9321e4c35a6/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201013132646-2da7054afaeb h1:HS9IzC4UFbpMBLQUDSQcU+ViVT1vdFCQVjdPVpTlZrs= -golang.org/x/sys v0.0.0-20201013132646-2da7054afaeb/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201014080544-cc95f250f6bc h1:HVFDs9bKvTxP6bh1Rj9MCSo+UmafQtI8ZWDPVwVk9g4= +golang.org/x/sys v0.0.0-20201014080544-cc95f250f6bc/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3 h1:cokOdA+Jmi5PJGXLlLllQSgYigAEfHXJAERHVMaCc2k= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= diff --git a/table.go b/table.go index 8147f50..f2a060d 100644 --- a/table.go +++ b/table.go @@ -212,6 +212,10 @@ func (c *TableCell) GetLastPosition() (x, y, width int) { // Table cell is defined via SetCell() by the TableCell type. They can be added // dynamically to the table and changed any time. // +// Each row of the table must have the same number of columns when it is drawn +// or navigated. This isn't strictly enforced, however you may encounter issues +// when navigating a table with rows of varied column sizes. +// // The most compact display of a table is without borders. Each row will then // occupy one row on screen and columns are separated by the rune defined via // SetSeparator() (a space character by default).