Skip to content

Commit

Permalink
fix calculation for longest line
Browse files Browse the repository at this point in the history
  • Loading branch information
SilenZcience committed Feb 22, 2023
1 parent 6851c64 commit ce11c06
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cat_win/util/Holder.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ def __calcMaxLine__(self, file: str) -> int:
heap = nlargest(1, lines, len)
if len(heap) == 0:
return 0
longest_line_len = len(heap[0][:-1].rstrip())
last_line_len = len(lines[-1].rstrip())
longest_line_len = len(heap[0][:-1].rstrip(b'\n').rstrip(b'\r'))
last_line_len = len(lines[-1].rstrip(b'\n').rstrip(b'\r'))

return len(str(max(longest_line_len, last_line_len)))

Expand Down

0 comments on commit ce11c06

Please sign in to comment.