summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorhut <hut@lepus.uberspace.de>2015-03-09 20:19:46 +0100
committerhut <hut@lepus.uberspace.de>2015-03-09 20:20:42 +0100
commitf08fc58366502baf8cb6534c0e9b58cddec982f8 (patch)
treecd5a6cea3037ac32eb22bf36617faf57c7bab2ac
parent26888efbc670e44a552e491d9ff5b90b8b6d6c60 (diff)
downloadranger-f08fc58366502baf8cb6534c0e9b58cddec982f8.tar.gz
core.linemode: fix up vifon's patches from PR #264
-rw-r--r--ranger/config/commands.py6
-rw-r--r--ranger/container/fsobject.py4
-rw-r--r--ranger/core/linemode.py4
3 files changed, 7 insertions, 7 deletions
diff --git a/ranger/config/commands.py b/ranger/config/commands.py
index 60b5a26f..a92dfa80 100644
--- a/ranger/config/commands.py
+++ b/ranger/config/commands.py
@@ -390,7 +390,7 @@ class setintag(setlocal):
 class default_linemode(Command):
     def execute(self):
         import re
-        from ranger.core.linemode import REGISTERED_LINEMODES
+        from ranger.container.fsobject import FileSystemObject
 
         if len(self.args) < 2:
             self.fm.notify("Usage: default_linemode [path=<regexp> | tag=<tag(s)>] <linemode>", bad=True)
@@ -410,9 +410,9 @@ class default_linemode(Command):
 
         # Extract and validate the line mode from the command line
         linemode = self.rest(1)
-        if linemode not in REGISTERED_LINEMODES:
+        if linemode not in FileSystemObject.linemode_dict:
             self.fm.notify("Invalid linemode: %s; should be %s" %
-                    (linemode, "/".join(REGISTERED_LINEMODES)), bad=True)
+                    (linemode, "/".join(FileSystemObject.linemode_dict)), bad=True)
 
         # Add the prepared entry to the fm.default_linemodes
         entry = [method, argument, linemode]
diff --git a/ranger/container/fsobject.py b/ranger/container/fsobject.py
index f7cf7f97..6cdaa727 100644
--- a/ranger/container/fsobject.py
+++ b/ranger/container/fsobject.py
@@ -17,7 +17,7 @@ from grp import getgrgid
 from os import lstat, stat, getcwd
 from os.path import abspath, basename, dirname, realpath, splitext, extsep, relpath
 from pwd import getpwuid
-from ranger.core.linemode import DEFAULT_LINEMODE, REGISTERED_LINEMODES
+from ranger.core.linemode import *
 from ranger.core.shared import FileManagerAware, SettingsAware
 from ranger.ext.shell_escape import shell_escape
 from ranger.ext.spawn import spawn
@@ -114,7 +114,7 @@ class FileSystemObject(FileManagerAware, SettingsAware):
 
         # Set the line mode from fm.default_linemodes
         for method, argument, linemode in self.fm.default_linemodes:
-            if linemode in linemode_dict:
+            if linemode in self.linemode_dict:
                 if method == "always":
                     self._linemode = linemode
                     break
diff --git a/ranger/core/linemode.py b/ranger/core/linemode.py
index ee770cb0..c394bc15 100644
--- a/ranger/core/linemode.py
+++ b/ranger/core/linemode.py
@@ -39,7 +39,7 @@ class DefaultLinemode(LinemodeBase):
     name = "filename"
 
     def filetitle(self, file, metadata):
-        return file.drawn_basename
+        return file.relative_path
 
     def infostring(self, file, metadata):
         # Should never be called for this linemode, implemented in BrowserColumn
@@ -72,7 +72,7 @@ class PermissionsLinemode(LinemodeBase):
 
     def filetitle(self, file, metadata):
         return "%s %s %s %s" % (file.get_permission_string(),
-                file.user, file.group, file.drawn_basename)
+                file.user, file.group, file.relative_path)
 
     def infostring(self, file, metadata):
         return ""