summary refs log tree commit diff stats
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
parentffc86e63f325a544d533b2a605e112ebc044f90e (diff)
downloadranger-1f124acd4a650a0f7ecb72c3abdd675c0c04e353.tar.gz
rc.conf: added pP/pO keys for FIFO-queued copying, fixes #345
-rw-r--r--doc/ranger.18
-rw-r--r--doc/ranger.pod5
-rw-r--r--ranger/config/rc.conf2
-rw-r--r--ranger/core/actions.py5
-rw-r--r--ranger/core/loader.py10
5 files changed, 24 insertions, 6 deletions
diff --git a/doc/ranger.1 b/doc/ranger.1
index 42eca7e6..ea720903 100644
--- a/doc/ranger.1
+++ b/doc/ranger.1
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.29)
 .\"
 .\" Standard preamble:
 .\" ========================================================================
@@ -133,7 +133,7 @@
 .\" ========================================================================
 .\"
 .IX Title "RANGER 1"
-.TH RANGER 1 "ranger-1.7.1" "05/04/2015" "ranger manual"
+.TH RANGER 1 "ranger-1.7.1" "07/15/2015" "ranger manual"
 .\" For nroff, turn off justification.  Always turn off hyphenation; it makes
 .\" way too many mistakes in technical documents.
 .if n .ad l
@@ -497,6 +497,10 @@ modern \s-1GUI\s0 programs.
 .IP "po" 14
 .IX Item "po"
 Paste the copied/cut files, overwriting existing files.
+.IP "pP, pO" 14
+.IX Item "pP, pO"
+Like pp and po, but queues the operation so that it will be executed \fIafter\fR
+any other operations.  Reminder: type \f(CW\*(C`w\*(C'\fR to open the task window.
 .IP "pl, pL" 14
 .IX Item "pl, pL"
 Create symlinks (absolute or relative) to the copied files
diff --git a/doc/ranger.pod b/doc/ranger.pod
index ab84de2c..b68595a9 100644
--- a/doc/ranger.pod
+++ b/doc/ranger.pod
@@ -418,6 +418,11 @@ modern GUI programs.
 
 Paste the copied/cut files, overwriting existing files.
 
+=item pP, pO
+
+Like pp and po, but queues the operation so that it will be executed I<after>
+any other operations.  Reminder: type C<w> to open the task window.
+
 =item pl, pL
 
 Create symlinks (absolute or relative) to the copied files
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:
'#n340'>340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425