diff --git a/application.py b/application.py index 10bc8bf..ea7a74d 100755 --- a/application.py +++ b/application.py @@ -45,7 +45,7 @@ class Application: self.y, self.x = self.stdscr.getmaxyx() # initialize some basic stuff - self.margins_visible = False + self.margins_visible = True #self.margins = [(80, 'blue'), (90, 'red')] self.margins = [(80, 'blue'), ] # each highlighted_range contains three things: [window, start_p, end_p] @@ -483,12 +483,13 @@ class Application: self.draw_status_bar(i) def draw_slot(self, i): - #return slot = self.bufferlist.slots[i] if slot.window is None: return w = slot.window + redattr = color.build_attr(color.pairs('red', 'default')) + lines = w.buffer.lines count = 0 (x, y) = w.first.xy() @@ -497,7 +498,7 @@ class Application: (px, py) = (None, None) while count < slot.height: if y >= len(lines): - self.win.addstr(count, 0, '~' + ' ' * (slot.width - 1)) + self.win.addstr(count, 0, '~' + ' ' * (slot.width - 1), redattr) else: if cy == y and cx >= x and cx < x + slot.width: px = cx - x @@ -518,13 +519,13 @@ class Application: if self.margins_visible: for (limit, shade) in self.margins: if self.x > limit: - for i in range(0, y): + for j in range(0, slot.height): # the actual character is the lower 8 bits, and the # attribute is the upper 8 bits; we will ignore the # attribute and just get the character - char = self.win.inch(i + slot.offset, limit) & 255 + char = self.win.inch(j + slot.offset, limit) & 255 attr = color.build('default', shade, 'bold') - self.win.addch(i + slot.offset, limit, char, attr) + self.win.addch(j + slot.offset, limit, char, attr) if self.mini_active is False and self.active_slot == i: if False and w.active_point is not None and w.point_is_visible(w.active_point): @@ -587,10 +588,10 @@ class Application: # 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" + #status = format % (modflag, name, w.mode.name(), cursor.y+1, cursor.x+1, w.first, 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,