Fix off-by-one error causing display of spurious line when clamping with filter turned on

This commit is contained in:
René Stadler 2007-12-18 15:26:05 +02:00 committed by Stefan Sauer
parent 8e6ad93d99
commit 075d186296

View file

@ -573,7 +573,7 @@ class FilteredLogModel (FilteredLogModelBase):
last_index = len (self.line_offsets) - 1 last_index = len (self.line_offsets) - 1
if end_index < last_index: if end_index < last_index:
self.__remove_range (end_index + 1, last_index - 1) self.__remove_range (end_index + 1, last_index)
if start_index > 0: if start_index > 0:
self.__remove_range (0, start_index - 1) self.__remove_range (0, start_index - 1)
@ -1669,13 +1669,14 @@ class Window (object):
try: try:
line_index = self.get_active_line_index () line_index = self.get_active_line_index ()
except ValueError: except ValueError:
super_index = None
self.logger.debug ("no line selected") self.logger.debug ("no line selected")
selected_index = None
else: else:
self.logger.debug ("pushing selected line %i", line_index) super_index = model.line_index_to_top (line_index)
selected_index = model.line_index_to_top (line_index) self.logger.debug ("pushing selected line %i (abs %i)",
line_index, super_index)
self.default_index = selected_index self.default_index = super_index
def update_model (self, model = None): def update_model (self, model = None):