From e0136e785a271d5e5c705a5cf083b9122d6ce2ca Mon Sep 17 00:00:00 2001 From: Florent Le Coz Date: Tue, 29 Jan 2013 07:57:48 +0100 Subject: =?UTF-8?q?scroll=5Fto=5Fseparator=20now=20scrolls=20to=20the=20to?= =?UTF-8?q?p=20if=20there=E2=80=99s=20no=20separator.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/windows.py | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/windows.py b/src/windows.py index ccd8d9b0..beaca819 100644 --- a/src/windows.py +++ b/src/windows.py @@ -793,13 +793,15 @@ class TextWin(Win): self.pos = len(self.built_lines) - self.built_lines.index(None) - self.height + 1 if self.pos < 0: self.pos = 0 - # Chose a proper position (not too high) - self.scroll_up(0) - # Make “next highlight” work afterwards. This makes it easy to - # review all the highlights since the separator was placed, in - # the correct order. - self.hl_pos = len(self.highlights) - self.nb_of_highlights_after_separator - 1 - log.debug("self.hl_pos = %s" % self.hl_pos) + else: + self.pos = len(self.built_lines) - self.height + 1 + # Chose a proper position (not too high) + self.scroll_up(0) + # Make “next highlight” work afterwards. This makes it easy to + # review all the highlights since the separator was placed, in + # the correct order. + self.hl_pos = len(self.highlights) - self.nb_of_highlights_after_separator - 1 + log.debug("self.hl_pos = %s" % self.hl_pos) def remove_line_separator(self): """ -- cgit v1.2.3