diff --git a/application.py b/application.py index 4fc9179..4851628 100755 --- a/application.py +++ b/application.py @@ -459,7 +459,7 @@ class Application(object): self.draw_cursor() self.win.noutrefresh() curses.doupdate() - except: + except Exception, e: # ok, so there was a problem... # let's see if the screen changed sizes and if so, resize our slots self.resize_event() @@ -518,12 +518,11 @@ class Application(object): def highlight_char(self, sy, sx, fg='default', bg='default'): junk = self.win.inch(sy, sx) - char = junk & 255 - #attr = color.build(fg, bg, curses.A_REVERSE) + char = chr(junk & 255) attr = color.build(fg, bg) try: - self.win.addch(sy, sx, char, attr) - except: + self.win.addstr(sy, sx, char, attr) + except Exception, e: raise Exception, "(%d, %d, %r, %r) v. (%d, %d)" % \ (sy, sx, fg, bg, self.y, self.x) @@ -572,9 +571,9 @@ class Application(object): #if limit <= self.x: if limit < self.x: for j in range(0, slot.height): - char = self.win.inch(j + slot.offset, limit) & 255 + char = chr(self.win.inch(j + slot.offset, limit) & 255) attr = color.build('default', shade, 'bold') - self.win.addch(j + slot.offset, limit, char, attr) + self.win.addstr(j + slot.offset, limit, char, attr) def _draw_slot_raw(self, i): slot = self.bufferlist.slots[i] @@ -601,7 +600,7 @@ class Application(object): x = 0 y += 1 else: - self.win.addch(slot.offset + count, slot.width, '\\', redattr) + self.win.addstr(slot.offset + count, slot.width, '\\', redattr) x += slot.width count += 1 @@ -638,7 +637,7 @@ class Application(object): self.win.addstr(slot.offset + count, x_offset, s[:slot.width - x_offset], attr) if token_wrap: - self.win.addch(slot.offset + count, slot.width, '\\', redattr) + self.win.addstr(slot.offset + count, slot.width, '\\', redattr) x += slot.width count += 1 if token_done: @@ -709,7 +708,7 @@ class Application(object): self.draw_nothing() try: # fucking python, fucking curses, fucking fuck - self.win.addch(self.y-1, self.x-1, ' ') + self.win.addstr(self.y-1, self.x-1, ' ') except: pass