summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xtcvt.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/tcvt.py b/tcvt.py
index 64c2ff5..e97da3c 100755
--- a/tcvt.py
+++ b/tcvt.py
@@ -168,11 +168,20 @@ 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 == self.numcolumns * self.height:
+ self.curwin.scrollok(0) # disable scrolling for the addch call
+ try:
+ self.curwin.addch(self.curypos, self.curxpos, char,
+ self.attrs)
+ except curses.error:
+ # It errors out, but still draws the character.
+ # http://stackoverflow.com/a/41923640/1626632
+ pass
+ self.curwin.scrollok(1)
self.scroll()
self.move(self.ypos, 0)
else:
+ self.curwin.addch(self.curypos, self.curxpos, char, self.attrs)
self.move(self.ypos + 1, 0)
else:
self.curwin.addch(self.curypos, self.curxpos, char, self.attrs)