branch : pmacs2
This commit is contained in:
moculus 2008-12-05 05:41:02 +00:00
parent 3d33459c2d
commit 3884d940a3
1 changed files with 15 additions and 14 deletions

View File

@ -193,6 +193,7 @@ class Application(object):
self.config['default_color'] = ('default', 'default',) self.config['default_color'] = ('default', 'default',)
self.config['margin'] = 80 self.config['margin'] = 80
self.config['margin_color'] = 'blue' self.config['margin_color'] = 'blue'
self.config['use_last_replace'] = False
def completion_window_is_open(self): def completion_window_is_open(self):
n = self.complete_slot n = self.complete_slot
@ -292,9 +293,9 @@ class Application(object):
n = self.bufferlist.add_slot() n = self.bufferlist.add_slot()
self.bufferlist.set_slot(n, b) self.bufferlist.set_slot(n, b)
def remove_slot(self, n): def remove_slot(self, n):
assert len(self.bufferlist.slots) > 1, "oh no you didn't!" slots = self.bufferlist.slots
assert n >= 0 and n < len(self.bufferlist.slots), \ assert len(slots) > 1, "oh no you didn't!"
"invalid slot: %r (%r)" % (n, len(self.bufferlist.slots)) assert n >= 0 and n < len(slots), "invalid slot %r %r" % (n, len(slots))
self.bufferlist.remove_slot(n) self.bufferlist.remove_slot(n)
if self.active_slot > n: if self.active_slot > n:
self.active_slot = max(0, self.active_slot - 1) self.active_slot = max(0, self.active_slot - 1)
@ -306,9 +307,9 @@ class Application(object):
self.remove_slot(0) self.remove_slot(0)
def get_window_height_width(self, i): def get_window_height_width(self, i):
assert i >= 0 and i < len(self.bufferlist.slots), \ slots = self.bufferlist.slots
"invalid slot: %r" % slotname assert i >= 0 and i < len(slots), "invalid slot: %r" % slotname
slot = self.bufferlist.slots[i] slot = slots[i]
return (slot.height, slot.width) return (slot.height, slot.width)
# files and stuff # files and stuff