diff options
author | toonn <toonn@toonn.io> | 2022-05-26 20:07:47 +0200 |
---|---|---|
committer | toonn <toonn@toonn.io> | 2022-05-26 23:42:14 +0200 |
commit | 5db21cc02e10027bfc1148f85664c2c44b6b631d (patch) | |
tree | 092a9ce812308b45e3f3396721f6be94963dc288 | |
parent | 4d15badcccf029b9c400df56d4aaf865f7409456 (diff) | |
download | ranger-5db21cc02e10027bfc1148f85664c2c44b6b631d.tar.gz |
browsercolumn: Accept line_numbers case insensitively
-rw-r--r-- | ranger/gui/widgets/browsercolumn.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/ranger/gui/widgets/browsercolumn.py b/ranger/gui/widgets/browsercolumn.py index 57165424..14f68589 100644 --- a/ranger/gui/widgets/browsercolumn.py +++ b/ranger/gui/widgets/browsercolumn.py @@ -212,7 +212,7 @@ class BrowserColumn(Pager): # pylint: disable=too-many-instance-attributes def _format_line_number(self, linum_format, i, selected_i): line_number = i - if self.settings.line_numbers == 'relative': + if self.settings.line_numbers.lower() == 'relative': line_number = abs(selected_i - i) if not self.settings.relative_current_zero and line_number == 0: if self.settings.one_indexed: @@ -312,7 +312,10 @@ class BrowserColumn(Pager): # pylint: disable=too-many-instance-attributes # Check if current line has not already computed and cached if key in drawn.display_data: # Recompute line numbers because they can't be reliably cached. - if self.main_column and self.settings.line_numbers != 'false': + if ( + self.main_column + and self.settings.line_numbers.lower() != 'false' + ): line_number_text = self._format_line_number(linum_format, i, selected_i) @@ -337,7 +340,7 @@ class BrowserColumn(Pager): # pylint: disable=too-many-instance-attributes space = self.wid # line number field - if self.settings.line_numbers != 'false': + if self.settings.line_numbers.lower() != 'false': if self.main_column and space - linum_text_len > 2: line_number_text = self._format_line_number(linum_format, i, |