Skip to content

Commit

Permalink
Add check for correct resizing
Browse files Browse the repository at this point in the history
  • Loading branch information
donBarbos committed Nov 29, 2024
1 parent 78cb377 commit 4cf7509
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Lib/_pyrepl/reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -587,10 +587,10 @@ def setpos_from_xy(self, x: int, y: int) -> None:
def pos2xy(self) -> tuple[int, int]:
"""Return the x, y coordinates of position 'pos'."""
# this *is* incomprehensible, yes.
y = 0
p, y, l2 = 0, 0, []
pos = self.pos
assert 0 <= pos <= len(self.buffer)
if pos == len(self.buffer):
if pos == len(self.buffer) and len(self.screeninfo) > 0:
y = len(self.screeninfo) - 1
p, l2 = self.screeninfo[y]
return p + sum(l2) + l2.count(0), y
Expand Down

0 comments on commit 4cf7509

Please sign in to comment.