From 6dd0a7373824f42ef9fd159c4608efb31a3c8b91 Mon Sep 17 00:00:00 2001 From: Mark Rogalski Date: Mon, 16 May 2016 20:06:34 +0200 Subject: Add a "line_numbers" setting --- ranger/container/settings.py | 1 + ranger/gui/widgets/browsercolumn.py | 4 +--- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/ranger/container/settings.py b/ranger/container/settings.py index 14ff9bca..7b646744 100644 --- a/ranger/container/settings.py +++ b/ranger/container/settings.py @@ -26,6 +26,7 @@ ALLOWED_SETTINGS = { 'flushinput': bool, 'hidden_filter': str, 'idle_delay': int, + 'line_numbers': bool, 'max_console_history_size': (int, type(None)), 'max_history_size': (int, type(None)), 'metadata_deep_search': bool, diff --git a/ranger/gui/widgets/browsercolumn.py b/ranger/gui/widgets/browsercolumn.py index 12e98386..4de476dc 100644 --- a/ranger/gui/widgets/browsercolumn.py +++ b/ranger/gui/widgets/browsercolumn.py @@ -239,8 +239,6 @@ class BrowserColumn(Pager): copied = [f.path for f in self.fm.copy_buffer] - linum_mode_is_set = True - # 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 + @@ -299,7 +297,7 @@ class BrowserColumn(Pager): space = self.wid # line number field - if linum_mode_is_set: + if self.settings.line_numbers: if self.main_column and space - linum_text_len > 2: linum_format = "{0:>" + str(linum_text_len) + "} " line_number_text = linum_format.format(i) -- cgit 1.4.1-2-gfad0