summary refs log tree commit diff stats
path: root/ranger
diff options
context:
space:
mode:
authorhut <hut@lepus.uberspace.de>2015-07-15 00:06:02 +0200
committerhut <hut@lepus.uberspace.de>2015-07-15 00:15:50 +0200
commit442e731f188daf7722bbb2791a7a58e4496d190b (patch)
tree54a77f52b6886d753445b9ae23128c7431fbe216 /ranger
parentfd187b46fb02cf20fae98bebe65ade5e35073fa9 (diff)
downloadranger-442e731f188daf7722bbb2791a7a58e4496d190b.tar.gz
rc.conf: added pP/pO keys for FIFO-queued copying, fixes #345
Diffstat (limited to 'ranger')
-rw-r--r--ranger/config/rc.conf2
-rw-r--r--ranger/core/actions.py5
-rw-r--r--ranger/core/loader.py10
3 files changed, 13 insertions, 4 deletions
diff --git a/ranger/config/rc.conf b/ranger/config/rc.conf
index f34b6e0c..bb9af151 100644
--- a/ranger/config/rc.conf
+++ b/ranger/config/rc.conf
@@ -344,6 +344,8 @@ map I  eval fm.open_console('rename ' + fm.thisfile.relative_path, position=7)
 
 map pp paste
 map po paste overwrite=True
+map pP paste append=True
+map pO paste overwrite=True append=True
 map pl paste_symlink relative=False
 map pL paste_symlink relative=True
 map phl paste_hardlink
diff --git a/ranger/core/actions.py b/ranger/core/actions.py
index 442182ff..e3dba313 100644
--- a/ranger/core/actions.py
+++ b/ranger/core/actions.py
@@ -1217,9 +1217,10 @@ class Actions(FileManagerAware, SettingsAware):
                 link(source_path,
                     next_available_filename(target_path))
 
-    def paste(self, overwrite=False):
+    def paste(self, overwrite=False, append=False):
         """Paste the selected items into the current directory"""
-        self.loader.add(CopyLoader(self.copy_buffer, self.do_cut, overwrite))
+        loadable = CopyLoader(self.copy_buffer, self.do_cut, overwrite)
+        self.loader.add(loadable, append=append)
         self.do_cut = False
 
     def delete(self):
diff --git a/ranger/core/loader.py b/ranger/core/loader.py
index 8eda544f..f4694eca 100644
--- a/ranger/core/loader.py
+++ b/ranger/core/loader.py
@@ -275,14 +275,20 @@ class Loader(FileManagerAware):
             (self.throbber_status + 1) % len(self.throbber_chars)
         self.status = self.throbber_chars[self.throbber_status]
 
-    def add(self, obj):
+    def add(self, obj, append=False):
         """Add an object to the queue.
 
         It should have a load_generator method.
+
+        If the argument "append" is True, the queued object will be processed
+        last, not first.
         """
         while obj in self.queue:
             self.queue.remove(obj)
-        self.queue.appendleft(obj)
+        if append:
+            self.queue.append(obj)
+        else:
+            self.queue.appendleft(obj)
         if self.paused:
             obj.pause()
         else: