From e117b018ce7ac17da666a9f22a67be62117a9f79 Mon Sep 17 00:00:00 2001 From: moculus Date: Mon, 25 Jun 2007 16:35:43 +0000 Subject: [PATCH] fixed drawing bug --HG-- branch : pmacs2 --- application.py | 10 +++++----- window2.py | 4 +++- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/application.py b/application.py index 13e37a2..54ff906 100755 --- a/application.py +++ b/application.py @@ -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, diff --git a/window2.py b/window2.py index 75aaba6..d1d0d77 100644 --- a/window2.py +++ b/window2.py @@ -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