about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--ranger/gui/widgets/browsercolumn.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/ranger/gui/widgets/browsercolumn.py b/ranger/gui/widgets/browsercolumn.py
index 305b8284..0a3dc928 100644
--- a/ranger/gui/widgets/browsercolumn.py
+++ b/ranger/gui/widgets/browsercolumn.py
@@ -280,7 +280,7 @@ class BrowserColumn(Pager):  # pylint: disable=too-many-instance-attributes
         def nr_of_digits(number):
             return len(str(number))
 
-        scroll_end = self.scroll_begin + self.hei - 1
+        scroll_end = self.scroll_begin + min(self.hei, len(self.target)) - 1
         distance_to_top = selected_i - self.scroll_begin
         distance_to_bottom = scroll_end - selected_i
         one_indexed_offset = 1 if self.settings.one_indexed else 0