summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorhut <hut@hut.pm>2018-01-07 13:19:41 +0100
committerhut <hut@hut.pm>2018-01-07 13:19:41 +0100
commitc93bd0ffaf260087fbb23e5d24009e8c9692a6b6 (patch)
tree899c1d7c4634fdb46fa1902bd8e7d971e7be90f7
parent7769d0f2cdccf1c257f03d808248dbdf9b7ea593 (diff)
parent2e93ab65a1e71ebca8c44e08312667401b4ffbfa (diff)
downloadranger-c93bd0ffaf260087fbb23e5d24009e8c9692a6b6.tar.gz
Merge branch 'column_ratios_tab_completion' of https://github.com/Vifon/ranger
-rwxr-xr-xranger/config/commands.py19
1 files changed, 14 insertions, 5 deletions
diff --git a/ranger/config/commands.py b/ranger/config/commands.py
index df8022cf..7d690b4a 100755
--- a/ranger/config/commands.py
+++ b/ranger/config/commands.py
@@ -445,11 +445,20 @@ class set_(Command):
             return sorted(self.firstpart + setting for setting in settings
                           if setting.startswith(name))
         if not value:
-            # Cycle through colorschemes when name, but no value is specified
-            if name == "colorscheme":
-                return sorted(self.firstpart + colorscheme for colorscheme
-                              in get_all_colorschemes(self.fm))
-            return self.firstpart + str(settings[name])
+            value_completers = {
+                "colorscheme":
+                # Cycle through colorschemes when name, but no value is specified
+                lambda: sorted(self.firstpart + colorscheme for colorscheme
+                               in get_all_colorschemes(self.fm)),
+
+                "column_ratios":
+                lambda: self.firstpart + ",".join(map(str, settings[name])),
+            }
+
+            def default_value_completer():
+                return self.firstpart + str(settings[name])
+
+            return value_completers.get(name, default_value_completer)()
         if bool in settings.types_of(name):
             if 'true'.startswith(value.lower()):
                 return self.firstpart + 'True'