all wrapping is fixed (i think)

--HG--
branch : pmacs2
This commit is contained in:
moculus 2007-06-16 14:56:29 +00:00
parent f0384b064a
commit 2eb04a22c1
1 changed files with 9 additions and 6 deletions

View File

@ -517,7 +517,7 @@ class Application(object):
count = 0 count = 0
(x, y) = w.first.xy() (x, y) = w.first.xy()
while count < slot.height: while count < slot.height:
if p.y == y and p.x >= x and p.x < x + slot.width: if p.y == y and p.x >= x and p.x <= x + slot.width:
self.highlight_char(slot.offset + count, p.x - x) self.highlight_char(slot.offset + count, p.x - x)
break break
if x + slot.width > len(w.buffer.lines[y]): if x + slot.width > len(w.buffer.lines[y]):
@ -539,14 +539,17 @@ class Application(object):
while count < slot.height: while count < slot.height:
if y >= len(lines): if y >= len(lines):
self.win.addstr(slot.offset + count, 0, '~', redattr) self.win.addstr(slot.offset + count, 0, '~', redattr)
else: count += 1
line = lines[y][x:x + slot.width] continue
self.win.addstr(slot.offset + count, 0, line)
line = lines[y]
s = line[x:x + slot.width]
self.win.addstr(slot.offset + count, 0, s)
if x + slot.width >= len(line): if x + slot.width >= len(line):
x = 0 x = 0
y += 1 y += 1
else: else:
self.win.addch(slot.offset + count, slot.width, '\\', redattr)
x += slot.width x += slot.width
count += 1 count += 1
@ -586,7 +589,7 @@ class Application(object):
c = self._get_token_color(w, token) c = self._get_token_color(w, token)
s = token.string[s_offset:] s = token.string[s_offset:]
token_done = x_offset + len(s) <= slot.width token_done = x_offset + len(s) <= slot.width
token_wrap = x_offset + len(s) >= slot.width token_wrap = x_offset + len(s) > slot.width
self.win.addstr(slot.offset + count, x_offset, s[:slot.width], c) self.win.addstr(slot.offset + count, x_offset, s[:slot.width], c)
if token_wrap: if token_wrap: