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-10-04 01:19:01 +0200
commit1f124acd4a650a0f7ecb72c3abdd675c0c04e353 (patch)
tree60e1206f4ee1411963e6b90e4913cb6518956724 /ranger
parentffc86e63f325a544d533b2a605e112ebc044f90e (diff)
downloadranger-1f124acd4a650a0f7ecb72c3abdd675c0c04e353.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: