summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorMark Rogalski <interesting.ones.are.already.taken@gmail.com>2016-05-16 20:08:37 +0200
committerMark Rogalski <interesting.ones.are.already.taken@gmail.com>2016-05-16 20:08:37 +0200
commit502ceb31e1f957b2d21e7f3dd38ecf284bde207d (patch)
tree4c13e4b9b4f0c28bfd2f8b020c8a71668f6d77fc
parent6dd0a7373824f42ef9fd159c4608efb31a3c8b91 (diff)
downloadranger-502ceb31e1f957b2d21e7f3dd38ecf284bde207d.tar.gz
Fix off-by-one error in space calculation
-rw-r--r--ranger/gui/widgets/browsercolumn.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/ranger/gui/widgets/browsercolumn.py b/ranger/gui/widgets/browsercolumn.py
index 4de476dc..5a72d1b9 100644
--- a/ranger/gui/widgets/browsercolumn.py
+++ b/ranger/gui/widgets/browsercolumn.py
@@ -299,12 +299,18 @@ class BrowserColumn(Pager):
             # line number field
             if self.settings.line_numbers:
                 if self.main_column and space - linum_text_len > 2:
-                    linum_format = "{0:>" + str(linum_text_len) + "} "
+                    linum_format = "{0:>" + str(linum_text_len) + "}"
+                    # add separator between line number and tag
+                    linum_format += " "
                     line_number_text = linum_format.format(i)
 
                     predisplay_left.append([line_number_text, ["directory"]])
                     space -= linum_text_len
 
+                    # Delete one additional character for space separator
+                    # between the line number and the tag
+                    space -= 1
+
             # selection mark
             tagmark = self._draw_tagged_display(tagged, tagged_marker)
             tagmarklen = self._total_len(tagmark)