From c691fc4657905bf15964aa36b459544d0a81d3c7 Mon Sep 17 00:00:00 2001 From: Helmut Grohne Date: Fri, 9 Dec 2016 21:14:16 +0100 Subject: fix adding characters at the end of the window When the number of columns wasn't exactly 2 (the default), adding a character at the end of the window could fail at scrolling thus yielding corrupted output. --- tcvt.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tcvt.py') diff --git a/tcvt.py b/tcvt.py index 3831a83..1b3bbfd 100755 --- a/tcvt.py +++ b/tcvt.py @@ -168,7 +168,7 @@ class Columns: def addch(self, char): if self.xpos == self.columnwidth - 1: self.curwin.insch(self.curypos, self.curxpos, char, self.attrs) - if self.ypos + 1 == 2 * self.height: + if self.ypos + 1 == self.numcolumns * self.height: self.scroll() self.move(self.ypos, 0) else: -- cgit v1.2.3