File tree Expand file tree Collapse file tree 1 file changed +15
-5
lines changed
Expand file tree Collapse file tree 1 file changed +15
-5
lines changed Original file line number Diff line number Diff line change @@ -61,11 +61,7 @@ func (tw *TabWriter) outputRows(rows [][]string, widths []int) error {
6161
6262 for j , cell := range row {
6363 if slices .Contains (tw .HideColumns , j ) {
64- output .WriteString (abbreviate (cell , 0 ))
65-
66- if len (cell ) > 0 && (cell [len (cell )- 1 ] == '\n' || cell [len (cell )- 1 ] == '\f' ) {
67- output .WriteByte (cell [len (cell )- 1 ])
68- }
64+ output .WriteString (emptyCell (cell ))
6965
7066 continue
7167 }
@@ -91,6 +87,20 @@ func (tw *TabWriter) outputRows(rows [][]string, widths []int) error {
9187 return err
9288}
9389
90+ func emptyCell (cell string ) string {
91+ if cell == "" {
92+ return ""
93+ }
94+
95+ abbr := abbreviate (cell , 0 )
96+
97+ if cell [len (cell )- 1 ] == '\n' || cell [len (cell )- 1 ] == '\f' {
98+ abbr += cell [len (cell )- 1 :]
99+ }
100+
101+ return abbr
102+ }
103+
94104func findCell (buf []byte ) (string , int , []byte ) {
95105 var (
96106 cell string
You can’t perform that action at this time.
0 commit comments