Commits

Andreas Stührk committed b3bf703

Fix off-by-one in lines-to-clear calculation and remove some unneeded code.

Comments (0)

Files changed (1)

 
         n = 1
 
-        if x == 0:
-            y -= 1
-            x = gethw()[1]
-
         # Delete following lines if the current string is greater than the
         # screen width. Curses does not handle that on its own.
         width = self.scr.getmaxyx()[1]
-        for y in xrange(self.iy + 1, self.iy + len(self.s) // width + 2):
+        for y in xrange(self.iy + 1, self.iy + len(self.s) // width + 1):
             self.scr.move(y, 0)
             self.scr.clrtoeol()
 
         # It seems as if curses does not handle this on its own, which
         # makes me sad.
         width = self.scr.getmaxyx()[1]
-        for y in xrange(self.iy + 1, self.iy + len(self.s) // width + 2):
+        for y in xrange(self.iy + 1, self.iy + len(self.s) // width + 1):
             self.scr.move(y, 0)
             self.scr.clrtoeol()