summary refs log tree commit diff stats
path: root/ranger
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2010-04-13 17:57:46 +0200
committerhut <hut@lavabit.com>2010-04-13 17:57:46 +0200
commit447cbcd65588eafdb85b407750602c0fdd591ef4 (patch)
tree22d9bdbe6481a945dba0e57c6f9f2b9639fe0a94 /ranger
parentd492db527bd0a610bef85682615de2c25d5145d6 (diff)
downloadranger-447cbcd65588eafdb85b407750602c0fdd591ef4.tar.gz
dirarg: added unit test and almost working implementaiton
Diffstat (limited to 'ranger')
-rw-r--r--ranger/core/actions.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/ranger/core/actions.py b/ranger/core/actions.py
index 7b8d192d..df623c77 100644
--- a/ranger/core/actions.py
+++ b/ranger/core/actions.py
@@ -545,7 +545,7 @@ class Actions(FileManagerAware, EnvironmentAware, SettingsAware):
 	def copy(self, narg=None, dirarg=None):
 		"""Copy the selected items"""
 		direction = Direction(dirarg or {})
-		selected = direction.select(
+		pos, selected = direction.select(
 				override=narg,
 				lst=self.env.cwd.files,
 				current=self.env.cwd.pointer,
@@ -553,7 +553,11 @@ class Actions(FileManagerAware, EnvironmentAware, SettingsAware):
 
 		selected = selected or self.env.get_selection()
 		self.env.copy = set(f for f in selected if f in self.env.cwd.files)
+		self.env.copy.add(self.env.cwd.pointed_obj)
 		self.env.cut = False
+		self.env.cwd.pointer = pos
+		self.env.cwd.correct_pointer()
+		self.env.copy.add(self.env.cwd.pointed_obj)
 		self.ui.browser.main_column.request_redraw()
 
 	def cut(self, narg=None, dirarg=None):