summary refs log tree commit diff stats
path: root/ranger/gui/widgets/browsercolumn.py
diff options
context:
space:
mode:
Diffstat (limited to 'ranger/gui/widgets/browsercolumn.py')
-rw-r--r--ranger/gui/widgets/browsercolumn.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/ranger/gui/widgets/browsercolumn.py b/ranger/gui/widgets/browsercolumn.py
index eff7fda6..9ab668e1 100644
--- a/ranger/gui/widgets/browsercolumn.py
+++ b/ranger/gui/widgets/browsercolumn.py
@@ -241,7 +241,11 @@ class BrowserColumn(Pager):
 
         linum_mode_is_set = True
 
-        linum_text_len = len(str(self.scroll_begin + self.hei))
+        # Set the size of the linum text field to the number of digits in the
+        # number of files in directory.
+        # Setting this to something like the len of (self.scroll_begin +
+        # self.hei) leads to ragged field lengths when digit amounts change.
+        linum_text_len = len(str(len(self.target.files)))
 
         selected_i = self._get_index_of_selected_file()
         for line in range(self.hei):