fixed drawing bug

--HG--
branch : pmacs2
This commit is contained in:
moculus 2007-06-25 16:35:43 +00:00
parent ad04ba8b41
commit e117b018ce
2 changed files with 8 additions and 6 deletions

View File

@ -529,7 +529,7 @@ class Application(object):
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]):
if x + slot.width >= len(w.buffer.lines[y]):
x = 0
y += 1
else:
@ -654,10 +654,10 @@ class Application(object):
perc = "%2d%%" % (first.y*100 / len(b.lines))
# XYZ: we should actually use more of the 'state' variables
format = "----:%s-Fl %-18s (%s)--L%d--C%d--%s"
status = format % (modflag, name, w.mode.name(), cursor.y+1, cursor.x+1, perc)
#format = "----:%s-Fl %-18s (%s)--L%d--C%d--%s--%s--%s"
#status = format % (modflag, name, w.mode.name(), cursor.y+1, cursor.x+1, w.first, w.last, perc)
#format = "----:%s-Fl %-18s (%s)--L%d--C%d--%s"
#status = format % (modflag, name, w.mode.name(), cursor.y+1, cursor.x+1, perc)
format = "----:%s-Fl %-18s (%s)--L%d--C%d--%s--%s--%s--%s"
status = format % (modflag, name, w.mode.name(), cursor.y+1, cursor.x+1, w.first, cursor, w.last, perc)
status = status[:slot.width + 1]
status += "-" * (slot.width - len(status) + 1)
self.win.addnstr(slot.height + slot.offset, 0, status, slot.width + 1,

View File

@ -390,6 +390,8 @@ class Window(object):
def goto_beginning(self):
self.cursor = Point(0, 0)
self.assure_visible_cursor()
def goto_endZZZ(self):
self.cursor = self.buffer.get_buffer_end()
def goto_end(self):
self.cursor = self.buffer.get_buffer_end()
(x, y) = self.logical_cursor().xy()
@ -404,7 +406,7 @@ class Window(object):
(x, y) = (0, 0)
break
counter += 1
self.first = Point(x - (x % self.width), y)
self.first = Point(x - (x % self.width), y + 2)
self.redraw()
# mark manipulation