Skip to content

Commit

Permalink
[column] make getMaxWidth() faster if column has many wide cells
Browse files Browse the repository at this point in the history
  • Loading branch information
midichef authored and anjakefala committed Jul 17, 2023
1 parent bca5932 commit 03ac8b6
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions visidata/column.py
Original file line number Diff line number Diff line change
Expand Up @@ -436,6 +436,8 @@ def getMaxWidth(self, rows):
row_w = dispwidth(self.getDisplayValue(r), maxwidth=self.sheet.windowWidth)
if w_max < row_w:
w_max = row_w
if w_max >= self.sheet.windowWidth:
break
w = w_max
w = max(w, nlen)+2
w = min(w, self.sheet.windowWidth)
Expand Down

0 comments on commit 03ac8b6

Please sign in to comment.