mirror of
https://github.com/restic/restic.git
synced 2025-12-12 06:32:06 +00:00
Use character display width for table padding
Using len(...) for table cell padding produced wrong results for unicode chracters leading to misaligned tables. Implementation changed to take the actual terminal display width into consideration.
This commit is contained in:
@@ -126,7 +126,7 @@ foo 2018-08-19 22:22:22 xxx other /home/user/other
|
||||
Time string
|
||||
Tags, Dirs []string
|
||||
}
|
||||
table.AddRow(data{"foo", "2018-08-19 22:22:22", []string{"work", "go"}, []string{"/home/user/work", "/home/user/go"}})
|
||||
table.AddRow(data{"foo", "2018-08-19 22:22:22", []string{"work", "go’s"}, []string{"/home/user/work", "/home/user/go"}})
|
||||
table.AddRow(data{"foo", "2018-08-19 22:22:22", []string{"other"}, []string{"/home/user/other"}})
|
||||
table.AddRow(data{"foo", "2018-08-19 22:22:22", []string{"other", "bar"}, []string{"/home/user/other"}})
|
||||
return table
|
||||
@@ -135,7 +135,7 @@ foo 2018-08-19 22:22:22 xxx other /home/user/other
|
||||
host name time zz tags dirs
|
||||
------------------------------------------------------------
|
||||
foo 2018-08-19 22:22:22 xxx work /home/user/work
|
||||
go /home/user/go
|
||||
go’s /home/user/go
|
||||
foo 2018-08-19 22:22:22 xxx other /home/user/other
|
||||
foo 2018-08-19 22:22:22 xxx other /home/user/other
|
||||
bar
|
||||
|
||||
Reference in New Issue
Block a user