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