summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHelmut Grohne <helmut@subdivi.de>2016-12-09 21:14:16 +0100
committerHelmut Grohne <helmut@subdivi.de>2016-12-09 21:14:16 +0100
commitc691fc4657905bf15964aa36b459544d0a81d3c7 (patch)
tree41a11619bbf8acf4614a3fa99d7676da58ac67de
parentf6f8d6d50b7823266684807eb4cad1db3e74c0d9 (diff)
downloadtcvt-c691fc4657905bf15964aa36b459544d0a81d3c7.tar.gz
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.
-rwxr-xr-xtcvt.py2
1 files changed, 1 insertions, 1 deletions
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: