diff --git a/application.py b/application.py index 1f83091..2294640 100755 --- a/application.py +++ b/application.py @@ -185,14 +185,15 @@ class Application(object): curses.def_prog_mode() def _load_config_defaults(self): - self.config['ignore_suffix'] = ['~', '-'] - self.config['error_timeout'] = -1 - self.config['max_error_len'] = 192 - self.config['max_num_kills'] = 64 - self.config['word_letters'] = string.letters + string.digits - self.config['default_color'] = ('default', 'default',) - self.config['margin'] = 80 - self.config['margin_color'] = 'blue' + self.config['ignore_suffix'] = ['~', '-'] + self.config['error_timeout'] = -1 + self.config['max_error_len'] = 192 + self.config['max_num_kills'] = 64 + self.config['word_letters'] = string.letters + string.digits + self.config['default_color'] = ('default', 'default',) + self.config['margin'] = 80 + self.config['margin_color'] = 'blue' + self.config['use_last_replace'] = False def completion_window_is_open(self): n = self.complete_slot @@ -292,9 +293,9 @@ class Application(object): n = self.bufferlist.add_slot() self.bufferlist.set_slot(n, b) def remove_slot(self, n): - assert len(self.bufferlist.slots) > 1, "oh no you didn't!" - assert n >= 0 and n < len(self.bufferlist.slots), \ - "invalid slot: %r (%r)" % (n, len(self.bufferlist.slots)) + slots = self.bufferlist.slots + assert len(slots) > 1, "oh no you didn't!" + assert n >= 0 and n < len(slots), "invalid slot %r %r" % (n, len(slots)) self.bufferlist.remove_slot(n) if self.active_slot > n: self.active_slot = max(0, self.active_slot - 1) @@ -306,9 +307,9 @@ class Application(object): self.remove_slot(0) def get_window_height_width(self, i): - assert i >= 0 and i < len(self.bufferlist.slots), \ - "invalid slot: %r" % slotname - slot = self.bufferlist.slots[i] + slots = self.bufferlist.slots + assert i >= 0 and i < len(slots), "invalid slot: %r" % slotname + slot = slots[i] return (slot.height, slot.width) # files and stuff