summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--TODO1
-rw-r--r--ranger/core/actions.py10
-rw-r--r--ranger/defaults/keys.py2
-rw-r--r--ranger/ext/direction.py2
-rw-r--r--ranger/help/movement.py5
5 files changed, 18 insertions, 2 deletions
diff --git a/TODO b/TODO
index d2aac406..1e02251c 100644
--- a/TODO
+++ b/TODO
@@ -87,6 +87,7 @@ Bugs
    (X) #87  10/05/10  files are not properly closed after previewing
    ( ) #88  10/05/10  race conditions for data loading from FS
    (X) #90  10/05/11  no link target for broken links
+   ( ) #94  10/05/26  "pressed keys" text cut off when chaining ctrl-XYZ keys
 
 
 Ideas
diff --git a/ranger/core/actions.py b/ranger/core/actions.py
index 69fbf32f..14f862c7 100644
--- a/ranger/core/actions.py
+++ b/ranger/core/actions.py
@@ -273,6 +273,16 @@ class Actions(FileManagerAware, EnvironmentAware, SettingsAware):
 		if hasattr(self.ui, 'status'):
 			self.ui.status.need_redraw = True
 
+	def mark_in_direction(self, val=True, dirarg=None):
+		cwd = self.env.cwd
+		direction = Direction(dirarg)
+		pos, selected = direction.select(lst=cwd.files, current=cwd.pointer,
+				pagesize=self.env.termsize[0])
+		cwd.pointer = pos
+		cwd.correct_pointer()
+		for item in selected:
+			cwd.mark_item(item, val)
+
 	# --------------------------
 	# -- Searching
 	# --------------------------
diff --git a/ranger/defaults/keys.py b/ranger/defaults/keys.py
index 59b45f8e..c95baed9 100644
--- a/ranger/defaults/keys.py
+++ b/ranger/defaults/keys.py
@@ -163,6 +163,8 @@ map('T', fm.tag_remove())
 map(' ', fm.mark(toggle=True))
 map('v', fm.mark(all=True, toggle=True))
 map('V', 'uv', fm.mark(all=True, val=False))
+map('<C-V><dir>', fm.mark_in_direction(val=True))
+map('u<C-V><dir>', fm.mark_in_direction(val=False))
 
 # ------------------------------------------ file system operations
 map('yy', 'y<dir>', fm.copy())
diff --git a/ranger/ext/direction.py b/ranger/ext/direction.py
index b9fbcac9..f36e22a6 100644
--- a/ranger/ext/direction.py
+++ b/ranger/ext/direction.py
@@ -134,7 +134,7 @@ class Direction(dict):
 			pos += current
 		return int(max(min(pos, maximum + offset - 1), minimum))
 
-	def select(self, lst, override, current, pagesize, offset=1):
+	def select(self, lst, current, pagesize, override=None, offset=1):
 		dest = self.move(direction=self.down(), override=override,
 			current=current, pagesize=pagesize, minimum=0, maximum=len(lst))
 		selection = lst[min(current, dest):max(current, dest) + offset]
diff --git a/ranger/help/movement.py b/ranger/help/movement.py
index 3287e9bb..3abec359 100644
--- a/ranger/help/movement.py
+++ b/ranger/help/movement.py
@@ -96,7 +96,10 @@ of the file you're pointing at.
 
 	<Space> mark a file
 	v	toggle all marks
-	V	remove all marks
+	V, uv	remove all marks
+	^V	mark files in a specific direction
+		e.g. ^Vgg marks all files from the current to the top
+	u^V	unmark files in a specific direction
 
 By "tagging" files, you can highlight them and mark them to be
 special in whatever context you want.  Tags are persistent across sessions.
href='/danisanti/profani-tty/commit/src/chat_session.h?id=5e7d2f5f91d47af330742a3b554e6f03450d6623'>5e7d2f5f ^
965e82b3 ^
5e7d2f5f ^

d339004f ^

894360dc ^
a2726b6a ^

13f0166a ^
a2726b6a ^






13f0166a ^
a2726b6a ^
5ce97728 ^
f8de2823 ^
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66