]> granicus.if.org Git - python/commitdiff
[Bug #1152762] Ensure _end_of_line() returns an x-coordinate that's within the text box
authorAndrew M. Kuchling <amk@amk.ca>
Thu, 2 Jun 2005 00:10:04 +0000 (00:10 +0000)
committerAndrew M. Kuchling <amk@amk.ca>
Thu, 2 Jun 2005 00:10:04 +0000 (00:10 +0000)
Lib/curses/textpad.py

index 28d78dd5cd382cae86f8b0b94b6820555a800681..120c5721ee73fcd3ee07fb9e19d3ba50eeeecbb0 100644 (file)
@@ -53,7 +53,7 @@ class Textbox:
         last = self.maxx
         while 1:
             if ascii.ascii(self.win.inch(y, last)) != ascii.SP:
-                last = last + 1
+                last = min(self.maxx, last+1)
                 break
             elif last == 0:
                 break