Too conservative column width estimation
To reproduce:
* Open a terminal with 96 columns
* Make the following files: `code Desktop Documents Downloads Music Pictures Public Templates Videos`
* Run `eza`
Expected: Since these elements takes up 79 columns (including 2 spaces between each element), it should fit on one row
Observed: It splits to two rows
I note that the longest file name here is 9 columns. If all files were 9 columns, it would require 9 * 9 + (9 - 1) * 2 = 97 columns. This is exactly the amount of columns that makes `eza` display these elements on one line.
So: Perhaps it's the case that eza, when computing the required number of rows, assumes that each column needs as many columns as its widest element. However, when actually displaying the items, they don't require the same number of columns.
1 条评论