From a1032643b32f446bccce1253aab7c470c1484d31 Mon Sep 17 00:00:00 2001 From: hut Date: Sun, 29 Aug 2010 19:58:28 +0200 Subject: defaults.keys: key pL to create relative symlinks --- ranger/core/actions.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'ranger/core/actions.py') diff --git a/ranger/core/actions.py b/ranger/core/actions.py index a5ee0d4d..a93344a4 100644 --- a/ranger/core/actions.py +++ b/ranger/core/actions.py @@ -23,6 +23,7 @@ from inspect import cleandoc import ranger from ranger.ext.direction import Direction +from ranger.ext.relative_symlink import relative_symlink from ranger.ext.shell_escape import shell_quote from ranger import fsobject from ranger.shared import FileManagerAware, EnvironmentAware, SettingsAware @@ -660,11 +661,14 @@ class Actions(FileManagerAware, EnvironmentAware, SettingsAware): self.env.cut = True self.ui.browser.main_column.request_redraw() - def paste_symlink(self): + def paste_symlink(self, relative=False): copied_files = self.env.copy for f in copied_files: try: - symlink(f.path, join(getcwd(), f.basename)) + if relative: + relative_symlink(f.path, join(getcwd(), f.basename)) + else: + symlink(f.path, join(getcwd(), f.basename)) except Exception as x: self.notify(x) -- cgit 1.4.1-2-gfad0