summary refs log tree commit diff stats
path: root/ranger
diff options
context:
space:
mode:
authorhut <hut@lepus.uberspace.de>2014-12-05 00:26:06 +0100
committerhut <hut@lepus.uberspace.de>2014-12-05 00:26:51 +0100
commitbb3e357a6df9c7ee6ecb351bda25a28b1e916a6e (patch)
tree909832725be39da710ebe5b9246f3bbb336d6347 /ranger
parent1f58043102c54d3fdc1243931e2b02151610dd2b (diff)
downloadranger-bb3e357a6df9c7ee6ecb351bda25a28b1e916a6e.tar.gz
core.actions: make the hardcoded linemode check more dynamic
Diffstat (limited to 'ranger')
-rw-r--r--ranger/core/actions.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/ranger/core/actions.py b/ranger/core/actions.py
index 13bf4dd3..879d1f68 100644
--- a/ranger/core/actions.py
+++ b/ranger/core/actions.py
@@ -27,6 +27,7 @@ from ranger.core.tab import Tab
 from ranger.container.file import File
 from ranger.core.loader import CommandLoader, CopyLoader
 from ranger.container.settings import ALLOWED_SETTINGS
+from ranger.container.fsobject import POSSIBLE_LINEMODES, DEFAULT_LINEMODE
 
 MACRO_FAIL = "<\x01\x01MACRO_HAS_NO_VALUE\x01\01>"
 
@@ -163,10 +164,10 @@ class Actions(FileManagerAware, EnvironmentAware, SettingsAware):
         - "depth" specifies the recursion depth
         """
 
-        assert mode in ("normal", "filename", "permissions", "papertitle")
+        assert mode == "normal" or mode in POSSIBLE_LINEMODES
 
         if mode == "normal":
-            mode = "filename"
+            mode = DEFAULT_LINEMODE
 
         if directory is None:
             directory = self.fm.thisdir