summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorent Le Coz <louiz@louiz.org>2013-01-29 07:57:48 +0100
committerFlorent Le Coz <louiz@louiz.org>2013-01-29 07:58:20 +0100
commite0136e785a271d5e5c705a5cf083b9122d6ce2ca (patch)
tree36d1546f52bda8cceee82c56406b7c216887eec8
parent13b5ab4b656e851022db1c673a0c596960da2b50 (diff)
downloadpoezio-e0136e785a271d5e5c705a5cf083b9122d6ce2ca.tar.gz
poezio-e0136e785a271d5e5c705a5cf083b9122d6ce2ca.tar.bz2
poezio-e0136e785a271d5e5c705a5cf083b9122d6ce2ca.tar.xz
poezio-e0136e785a271d5e5c705a5cf083b9122d6ce2ca.zip
scroll_to_separator now scrolls to the top if there’s no separator.
-rw-r--r--src/windows.py16
1 files 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):
"""