diff options
author | Ethan Kiang <chocopuff298@gmail.com> | 2020-11-19 00:56:12 +0800 |
---|---|---|
committer | toonn <toonn@toonn.io> | 2020-11-18 18:38:48 +0100 |
commit | 3645972216c01bddccf32eefb4900fd3b2782e9a (patch) | |
tree | 9fe11c68e8d53a000d0832c1a5bbd77e5ddb865b | |
parent | fefa151e4e318af3f316592201261bddbcbe41ed (diff) | |
download | ranger-3645972216c01bddccf32eefb4900fd3b2782e9a.tar.gz |
Explicit truthy logic for draw_borders_multipane
-rw-r--r-- | ranger/container/settings.py | 2 | ||||
-rw-r--r-- | ranger/gui/widgets/view_multipane.py | 8 |
2 files changed, 8 insertions, 2 deletions
diff --git a/ranger/container/settings.py b/ranger/container/settings.py index fc89763d..e7d6775d 100644 --- a/ranger/container/settings.py +++ b/ranger/container/settings.py @@ -106,7 +106,7 @@ ALLOWED_VALUES = { 'cd_tab_case': ['sensitive', 'insensitive', 'smart'], 'confirm_on_delete': ['multiple', 'always', 'never'], 'draw_borders': ['none', 'both', 'outline', 'separators'], - 'draw_borders_multipane': ['none', 'both', 'outline', + 'draw_borders_multipane': [None, 'none', 'both', 'outline', 'separators', 'active-pane'], 'line_numbers': ['false', 'absolute', 'relative'], 'nested_ranger_warning': ['true', 'false', 'error'], diff --git a/ranger/gui/widgets/view_multipane.py b/ranger/gui/widgets/view_multipane.py index f55687d5..0a4e3a25 100644 --- a/ranger/gui/widgets/view_multipane.py +++ b/ranger/gui/widgets/view_multipane.py @@ -20,7 +20,13 @@ class ViewMultipane(ViewBase): # pylint: disable=too-many-ancestors self.old_draw_borders = self._draw_borders_setting() def _draw_borders_setting(self): - return self.settings.draw_borders_multipane or self.settings.draw_borders + # If draw_borders_multipane has not been set, it defaults to `None` + # and we fallback to using draw_borders. Important to note: + # `None` is different from the string "none" referring to no borders + if self.settings.draw_borders_multipane != None: + return self.settings.draw_borders_multipane + else: + return self.settings.draw_borders def _layoutchange_handler(self): if self.fm.ui.browser == self: |