Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 7627617

Browse files
committed
[Bug #1152762] Ensure _end_of_line() returns an x-coordinate that's within the text box
1 parent d80ef02 commit 7627617

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

Lib/curses/textpad.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ def _end_of_line(self, y):
5353
last = self.maxx
5454
while 1:
5555
if ascii.ascii(self.win.inch(y, last)) != ascii.SP:
56-
last = last + 1
56+
last = min(self.maxx, last+1)
5757
break
5858
elif last == 0:
5959
break

0 commit comments

Comments
 (0)