From bb3e357a6df9c7ee6ecb351bda25a28b1e916a6e Mon Sep 17 00:00:00 2001 From: hut Date: Fri, 5 Dec 2014 00:26:06 +0100 Subject: core.actions: make the hardcoded linemode check more dynamic --- ranger/core/actions.py | 5 +++-- 1 file 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 -- cgit 1.4.1-2-gfad0