From 502ceb31e1f957b2d21e7f3dd38ecf284bde207d Mon Sep 17 00:00:00 2001 From: Mark Rogalski Date: Mon, 16 May 2016 20:08:37 +0200 Subject: Fix off-by-one error in space calculation --- ranger/gui/widgets/browsercolumn.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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) -- cgit 1.4.1-2-gfad0