diff options
author | toonn <toonn@toonn.io> | 2020-07-05 14:41:05 +0200 |
---|---|---|
committer | toonn <toonn@toonn.io> | 2020-07-05 14:41:05 +0200 |
commit | 74bb51835f50393c38a9ba9aaef9cfc978f30ba8 (patch) | |
tree | e0daf36f5561a1748f14c13554184ce170a6f96e | |
parent | 010804358aff7f932adc5979ca8dc7b35bde0d45 (diff) | |
parent | 94a21ef35169737922d6b4e22fe1e82ea37679af (diff) | |
download | ranger-74bb51835f50393c38a9ba9aaef9cfc978f30ba8.tar.gz |
Merge branch 'color-line-numbers'
-rw-r--r-- | ranger/colorschemes/default.py | 3 | ||||
-rw-r--r-- | ranger/colorschemes/jungle.py | 6 | ||||
-rw-r--r-- | ranger/colorschemes/snow.py | 3 | ||||
-rw-r--r-- | ranger/gui/context.py | 3 | ||||
-rw-r--r-- | ranger/gui/widgets/browsercolumn.py | 6 |
5 files changed, 16 insertions, 5 deletions
diff --git a/ranger/colorschemes/default.py b/ranger/colorschemes/default.py index 3d50e2e4..86d2fbba 100644 --- a/ranger/colorschemes/default.py +++ b/ranger/colorschemes/default.py @@ -64,6 +64,9 @@ class Default(ColorScheme): else: fg = red fg += BRIGHT + if context.line_number and not context.selected: + fg = default + attr &= ~bold if not context.selected and (context.cut or context.copied): attr |= bold fg = black diff --git a/ranger/colorschemes/jungle.py b/ranger/colorschemes/jungle.py index a1fd768d..c11ce64a 100644 --- a/ranger/colorschemes/jungle.py +++ b/ranger/colorschemes/jungle.py @@ -4,7 +4,7 @@ from __future__ import (absolute_import, division, print_function) from ranger.colorschemes.default import Default -from ranger.gui.color import green, red, blue +from ranger.gui.color import green, red, blue, bold class Scheme(Default): @@ -17,6 +17,10 @@ class Scheme(Default): and not context.inactive_pane: fg = self.progress_bar_color + if context.line_number and not context.selected: + fg = self.progress_bar_color + attr &= ~bold + if context.in_titlebar and context.hostname: fg = red if context.bad else blue diff --git a/ranger/colorschemes/snow.py b/ranger/colorschemes/snow.py index c5f23c1c..354c2a47 100644 --- a/ranger/colorschemes/snow.py +++ b/ranger/colorschemes/snow.py @@ -21,6 +21,9 @@ class Snow(ColorScheme): if context.directory: attr |= bold fg += BRIGHT + if context.line_number and not context.selected: + attr |= bold + fg += BRIGHT elif context.highlight: attr |= reverse diff --git a/ranger/gui/context.py b/ranger/gui/context.py index 96849686..202d6a53 100644 --- a/ranger/gui/context.py +++ b/ranger/gui/context.py @@ -16,7 +16,8 @@ CONTEXT_KEYS = [ 'good', 'bad', 'space', 'permissions', 'owner', 'group', 'mtime', 'nlink', 'scroll', 'all', 'bot', 'top', 'percentage', 'filter', - 'flat', 'marked', 'tagged', 'tag_marker', 'cut', 'copied', 'frozen', + 'flat', 'marked', 'tagged', 'tag_marker', 'line_number', + 'cut', 'copied', 'frozen', 'help_markup', # COMPAT 'seperator', 'key', 'special', 'border', # COMPAT 'title', 'text', 'highlight', 'bars', 'quotes', 'tab', 'loaded', diff --git a/ranger/gui/widgets/browsercolumn.py b/ranger/gui/widgets/browsercolumn.py index 1412ef6a..8632cc46 100644 --- a/ranger/gui/widgets/browsercolumn.py +++ b/ranger/gui/widgets/browsercolumn.py @@ -280,8 +280,6 @@ class BrowserColumn(Pager): # pylint: disable=too-many-instance-attributes # visible files in directory. linum_text_len = len(str(self.scroll_begin + self.hei)) linum_format = "{0:>" + str(linum_text_len) + "}" - # add separator between line number and tag - linum_format += " " selected_i = self._get_index_of_selected_file() for line in range(self.hei): @@ -347,12 +345,14 @@ class BrowserColumn(Pager): # pylint: disable=too-many-instance-attributes line_number_text = self._format_line_number(linum_format, i, selected_i) - predisplay_left.append([line_number_text, []]) + predisplay_left.append([line_number_text, ['line_number']]) space -= linum_text_len # Delete one additional character for space separator # between the line number and the tag space -= 1 + # add separator between line number and tag + predisplay_left.append([' ', []]) # selection mark tagmark = self._draw_tagged_display(tagged, tagged_marker) |