Skip to content

Commit

Permalink
core.actions: make the hardcoded linemode check more dynamic
Browse files Browse the repository at this point in the history
  • Loading branch information
hut committed Dec 4, 2014
1 parent 1f58043 commit bb3e357
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions ranger/core/actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
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>"

Expand Down Expand Up @@ -163,10 +164,10 @@ def linemode(self, mode, directory=None, depth=0):
- "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
Expand Down

0 comments on commit bb3e357

Please sign in to comment.