diff options
-rw-r--r-- | ranger/commands.py | 4 | ||||
-rw-r--r-- | ranger/fsobject/fsobject.py | 3 |
2 files changed, 6 insertions, 1 deletions
diff --git a/ranger/commands.py b/ranger/commands.py index c552053f..0903e00a 100644 --- a/ranger/commands.py +++ b/ranger/commands.py @@ -324,8 +324,12 @@ class rename(Command): """ def execute(self): + from ranger.fsobject.file import File line = parse(self.line) self.fm.rename(self.fm.env.cf, line.rest(1)) + f = File(line.rest(1)) + self.fm.env.pwd.pointed_obj = f + self.fm.env.cf = f def tab(self): return self._tab_directory_content() diff --git a/ranger/fsobject/fsobject.py b/ranger/fsobject/fsobject.py index 5ede5927..df7a989f 100644 --- a/ranger/fsobject/fsobject.py +++ b/ranger/fsobject/fsobject.py @@ -57,8 +57,9 @@ class FileSystemObject(MimeTypeAware, FileManagerAware): if type(self) == FileSystemObject: raise TypeError("Cannot initialize abstract class FileSystemObject") - from os.path import basename, dirname, realpath + from os.path import abspath, basename, dirname, realpath + path = abspath(path) self.path = path self.basename = basename(path) self.basename_lower = self.basename.lower() |