summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--ranger/core/actions.py8
-rw-r--r--ranger/defaults/commands.py5
-rw-r--r--ranger/fsobject/directory.py10
3 files changed, 14 insertions, 9 deletions
diff --git a/ranger/core/actions.py b/ranger/core/actions.py
index 51a70844..75f85baf 100644
--- a/ranger/core/actions.py
+++ b/ranger/core/actions.py
@@ -368,16 +368,16 @@ class Actions(FileManagerAware, EnvironmentAware, SettingsAware):
 	# -- Searching
 	# --------------------------
 
-	def search_file(self, text, regexp=True):
+	def search_file(self, text, offset=1, regexp=True):
 		if isinstance(text, str) and regexp:
 			try:
 				text = re.compile(text, re.L | re.U | re.I)
 			except:
 				return False
 		self.env.last_search = text
-		self.search(order='search')
+		self.search(order='search', offset=offset)
 
-	def search(self, order=None, forward=True):
+	def search(self, order=None, offset=1, forward=True):
 		original_order = order
 		if self.search_forward:
 			direction = bool(forward)
@@ -401,7 +401,7 @@ class Actions(FileManagerAware, EnvironmentAware, SettingsAware):
 			elif order == 'tag':
 				fnc = lambda x: x.realpath in self.tags
 
-			return self.env.cwd.search_fnc(fnc=fnc, forward=forward)
+			return self.env.cwd.search_fnc(fnc=fnc, offset=offset, forward=forward)
 
 		elif order in ('size', 'mimetype', 'ctime'):
 			cwd = self.env.cwd
diff --git a/ranger/defaults/commands.py b/ranger/defaults/commands.py
index 6258d30d..9861ddeb 100644
--- a/ranger/defaults/commands.py
+++ b/ranger/defaults/commands.py
@@ -91,6 +91,11 @@ class search(Command):
 		self.fm.search_file(parse(self.line).rest(1), regexp=True)
 
 
+class search_inc(Command):
+	def quick(self):
+		self.fm.search_file(parse(self.line).rest(1), regexp=True, offset=0)
+
+
 class shell(Command):
 	def execute(self):
 		line = parse(self.line)
diff --git a/ranger/fsobject/directory.py b/ranger/fsobject/directory.py
index 5d1a89a0..c5c1e6a9 100644
--- a/ranger/fsobject/directory.py
+++ b/ranger/fsobject/directory.py
@@ -339,18 +339,18 @@ class Directory(FileSystemObject, Accumulator, Loadable, SettingsAware):
 
 		Accumulator.move_to_obj(self, arg, attr='path')
 
-	def search_fnc(self, fnc, forward=True):
+	def search_fnc(self, fnc, offset=1, forward=True):
 		if not hasattr(fnc, '__call__'):
 			return False
 
 		length = len(self)
 
 		if forward:
-			generator = ((self.pointer + (x + 1)) % length \
-					for x in range(length-1))
+			generator = ((self.pointer + (x + offset)) % length \
+					for x in range(length - 1))
 		else:
-			generator = ((self.pointer - (x + 1)) % length \
-					for x in range(length-1))
+			generator = ((self.pointer - (x + offset)) % length \
+					for x in range(length - 1))
 
 		for i in generator:
 			_file = self.files[i]
le='Blame the previous revision' href='/akkartik/mu/blame/html/channel.mu.html?h=main&id=a809b975108e638fe99a295ce20327e6749499e7'>^
c5ffb6e1 ^

a654e4ec ^



e5c11a51 ^






















a654e4ec ^

c5ffb6e1 ^
e5c11a51 ^
a654e4ec ^
204dae92 ^

cdf28227 ^
204dae92 ^

4a48bedc ^
204dae92 ^


805d58c6 ^



204dae92 ^
cdf28227 ^
805d58c6 ^

204dae92 ^
cdf28227 ^
204dae92 ^

cdf28227 ^
204dae92 ^

4a48bedc ^
204dae92 ^
805d58c6 ^
cdf28227 ^
805d58c6 ^


204dae92 ^
805d58c6 ^
204dae92 ^


b301e0c0 ^
204dae92 ^
cdf28227 ^
204dae92 ^
cdf28227 ^

204dae92 ^


c5ffb6e1 ^


a654e4ec ^
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108