removed addch() to fix netbsd/alpha bugs

--HG--
branch : pmacs2
This commit is contained in:
moculus 2007-11-04 23:23:06 +00:00
parent 8be0b4f112
commit a003addde9
1 changed files with 9 additions and 10 deletions

View File

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